diff --git a/client/src/__tests__/unit-tests/driver/scanner.test.ts b/client/src/__tests__/unit-tests/driver/scanner.test.ts index 8644ebfb..9847a8e4 100644 --- a/client/src/__tests__/unit-tests/driver/scanner.test.ts +++ b/client/src/__tests__/unit-tests/driver/scanner.test.ts @@ -30,7 +30,7 @@ describe('BitBakeProjectScanner', () => { DoneCallback() }) void bitBakeProjectScanner.rescanProject() - }, 300000) + }, 120000) it('can get a list of layers', async () => { const layers = bitBakeProjectScanner.scanResult._layers diff --git a/client/src/ui/BitbakeCommands.ts b/client/src/ui/BitbakeCommands.ts index e3478bb4..f0aacb1c 100644 --- a/client/src/ui/BitbakeCommands.ts +++ b/client/src/ui/BitbakeCommands.ts @@ -13,7 +13,7 @@ import path from 'path' import { BitbakeRecipeTreeItem, DevtoolWorkspaceTreeItem } from './BitbakeRecipesView' import { type BitBakeProjectScanner, bitBakeProjectScanner } from '../driver/BitBakeProjectScanner' import { extractRecipeName } from '../lib/src/utils/files' -import { runBitbakeTerminal } from './BitbakeTerminal' +import { runBitbakeTerminal, runBitbakeTerminalCustomCommand } from './BitbakeTerminal' import { type BitbakeDriver } from '../driver/BitbakeDriver' import { sanitizeForShell } from '../lib/src/BitbakeSettings' import { type BitbakeTaskDefinition, type BitbakeTaskProvider } from './BitbakeTaskProvider' @@ -209,8 +209,12 @@ async function devtoolModifyCommand (bitbakeWorkspace: BitbakeWorkspace, bitbake if (chosenRecipe !== undefined) { logger.debug(`Command: devtool-modify: ${chosenRecipe}`) const command = `devtool modify ${chosenRecipe}` - await runBitbakeTerminal(bitbakeDriver, command, false) - await bitBakeProjectScanner.rescanProject(true) + const process = await runBitbakeTerminalCustomCommand(bitbakeDriver, command, `Bitbake: Devtool Modify: ${chosenRecipe}`) + process.on('exit', (code) => { + if (code === 0) { + void bitBakeProjectScanner.rescanProject(true) + } + }) } } @@ -239,7 +243,7 @@ async function devtoolUpdateCommand (bitbakeWorkspace: BitbakeWorkspace, bitbake } logger.debug(`Command: devtool-update: ${chosenRecipe}`) - await runBitbakeTerminal(bitbakeDriver, command, false) + await runBitbakeTerminalCustomCommand(bitbakeDriver, command, `Bitbake: Devtool Update: ${chosenRecipe}`) } async function devtoolResetCommand (bitbakeWorkspace: BitbakeWorkspace, bitbakeDriver: BitbakeDriver, uri?: any): Promise { @@ -247,8 +251,12 @@ async function devtoolResetCommand (bitbakeWorkspace: BitbakeWorkspace, bitbakeD if (chosenRecipe !== undefined) { logger.debug(`Command: devtool-reset: ${chosenRecipe}`) const command = `devtool reset ${chosenRecipe}` - await runBitbakeTerminal(bitbakeDriver, command, false) - await bitBakeProjectScanner.rescanProject(true) + const process = await runBitbakeTerminalCustomCommand(bitbakeDriver, command, `Bitbake: Devtool Reset: ${chosenRecipe}`) + process.on('exit', (code) => { + if (code === 0) { + void bitBakeProjectScanner.rescanProject(true) + } + }) } } diff --git a/integration-tests/src/tests/bitbake-commands.test.ts b/integration-tests/src/tests/bitbake-commands.test.ts index f4a95af0..4fd74f51 100644 --- a/integration-tests/src/tests/bitbake-commands.test.ts +++ b/integration-tests/src/tests/bitbake-commands.test.ts @@ -38,7 +38,7 @@ suite('Bitbake Commands Test Suite', () => { const files = await vscode.workspace.findFiles('build/tmp/work/*/base-files/*/issue') return files.length === 1 }) - }).timeout(300000) + }).timeout(120000) test('Bitbake can clean a recipe', async () => { await vscode.commands.executeCommand('bitbake.clean-recipe', 'base-files') @@ -46,7 +46,7 @@ suite('Bitbake Commands Test Suite', () => { const files = await vscode.workspace.findFiles('build/tmp/work/*/base-files') return files.length === 0 }) - }).timeout(300000) + }).timeout(120000) test('Bitbake can run from task.json', async () => { let taskExecuted = false @@ -68,5 +68,5 @@ suite('Bitbake Commands Test Suite', () => { const files = await vscode.workspace.findFiles('build/tmp/work/*/base-files/*/temp/log.do_fetch') assert.strictEqual(files.length, 1) - }).timeout(300000) + }).timeout(120000) }) diff --git a/integration-tests/src/tests/bitbake-parse.test.ts b/integration-tests/src/tests/bitbake-parse.test.ts index 1a2d225c..69e05c8d 100644 --- a/integration-tests/src/tests/bitbake-parse.test.ts +++ b/integration-tests/src/tests/bitbake-parse.test.ts @@ -62,7 +62,7 @@ suite('Bitbake Parsing Test Suite', () => { const diagnostics = vscode.languages.getDiagnostics() assert.strictEqual(diagnostics.length, 0) - }).timeout(300000) + }).timeout(120000) test('Bitbake can detect parsing errors', async () => { let taskExecuted = false @@ -87,5 +87,5 @@ suite('Bitbake Parsing Test Suite', () => { const diagnostics = vscode.languages.getDiagnostics() assert.strictEqual(diagnostics.length, 1) - }).timeout(300000) + }).timeout(120000) }) diff --git a/integration-tests/src/tests/command-wrapper.test.ts b/integration-tests/src/tests/command-wrapper.test.ts index fe8b4475..b97785d9 100644 --- a/integration-tests/src/tests/command-wrapper.test.ts +++ b/integration-tests/src/tests/command-wrapper.test.ts @@ -43,7 +43,7 @@ suite('Bitbake Command Wrapper', () => { }) suiteTeardown(async function (this: Mocha.Context) { - this.timeout(300000) + this.timeout(120000) await vscode.workspace.fs.delete(buildFolder, { recursive: true }) const bitbakeConfiguration = vscode.workspace.getConfiguration('bitbake') @@ -67,5 +67,5 @@ suite('Bitbake Command Wrapper', () => { ) return definitions.length === 1 }) - }).timeout(300000) + }).timeout(120000) }) diff --git a/integration-tests/src/tests/completion.test.ts b/integration-tests/src/tests/completion.test.ts index 0381a119..804cc998 100644 --- a/integration-tests/src/tests/completion.test.ts +++ b/integration-tests/src/tests/completion.test.ts @@ -47,17 +47,17 @@ suite('Bitbake Completion Test Suite', () => { const position = new vscode.Position(0, 2) const expected = 'DESCRIPTION' await testCompletion(position, expected) - }).timeout(300000) + }).timeout(120000) test('Completion appears properly on embedded python', async () => { const position = new vscode.Position(3, 6) const expected = 'print' await testCompletion(position, expected) - }).timeout(300000) + }).timeout(120000) test('Completion appears properly on embedded bash', async () => { const position = new vscode.Position(7, 6) const expected = 'echo' await testCompletion(position, expected) - }).timeout(300000) + }).timeout(120000) }) diff --git a/integration-tests/src/tests/hover.test.ts b/integration-tests/src/tests/hover.test.ts index 965174d2..e9f324a3 100644 --- a/integration-tests/src/tests/hover.test.ts +++ b/integration-tests/src/tests/hover.test.ts @@ -46,29 +46,29 @@ suite('Bitbake Hover Test Suite', () => { const position = new vscode.Position(0, 2) const expected = 'The package description used by package managers' await testHover(position, expected) - }).timeout(300000) + }).timeout(120000) test('Hover appears properly on embedded python', async () => { const position = new vscode.Position(3, 6) const expected = 'def print' await testHover(position, expected) - }).timeout(300000) + }).timeout(120000) test('Hover appears properly on embedded bash', async () => { const position = new vscode.Position(7, 6) const expected = 'echo' await testHover(position, expected) - }).timeout(300000) + }).timeout(120000) test('Hover shows Yocto task description on python function declaration', async () => { const position = new vscode.Position(10, 9) const expected = 'The default task for all recipes. This task depends on all other normal' await testHover(position, expected) - }).timeout(300000) + }).timeout(120000) test('Hover shows Yocto task description on bash function declaration', async () => { const position = new vscode.Position(13, 1) const expected = 'The default task for all recipes. This task depends on all other normal' await testHover(position, expected) - }).timeout(300000) + }).timeout(120000) }) diff --git a/integration-tests/src/utils/async.ts b/integration-tests/src/utils/async.ts index a2d1266a..a76828f6 100644 --- a/integration-tests/src/utils/async.ts +++ b/integration-tests/src/utils/async.ts @@ -13,7 +13,7 @@ export async function delay (ms: number): Promise { /// Asserts that the given predicate will come true within the given timeout. /// Since we often want to test events have happened but they depend on asynchronous /// external VSCode and extension processes, we can't listen for them directly. -export async function assertWillComeTrue (predicate: () => Promise, timeout: number = 300000): Promise { +export async function assertWillComeTrue (predicate: () => Promise, timeout: number = 120000): Promise { const startTime = Date.now() while (!(await predicate()) && (Date.now() - startTime < timeout)) { await delay(100)