Skip to content

Commit cd49060

Browse files
committed
Test: Increase interval delay for definitions integration tests
The message was flooding the output and the tests were randomly failing on the slow CI CPU because the request hogged the CPU.
1 parent 49a5a4c commit cd49060

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

integration-tests/src/tests/definition.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ suite('Bitbake Definition Test Suite', () => {
3737
position
3838
)
3939
return definitionResult.length > 0
40-
})
40+
}, 5000)
4141
definitionResult.forEach((definition) => {
4242
const receivedUri = getDefinitionUri(definition)
4343
assert.equal(receivedUri.fsPath.endsWith(expectedPathEnding), true)

integration-tests/src/utils/async.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export async function delay (ms: number): Promise<void> {
1313
/// Asserts that the given predicate will come true within the given timeout.
1414
/// Since we often want to test events have happened but they depend on asynchronous
1515
/// external VSCode and extension processes, we can't listen for them directly.
16-
export async function assertWillComeTrue (predicate: () => Promise<boolean>, timeout: number = 300000): Promise<void> {
16+
export async function assertWillComeTrue (predicate: () => Promise<boolean>, interval: number = 250, timeout: number = 300000): Promise<void> {
1717
const startTime = Date.now()
1818
while (!(await predicate()) && (Date.now() - startTime < timeout)) {
19-
await delay(250)
19+
await delay(interval)
2020
}
2121
assert.ok(predicate())
2222
}

0 commit comments

Comments
 (0)