From 675ed742e8a49721bca44a9178aaa15f0f39863d Mon Sep 17 00:00:00 2001 From: Enguerrand de Ribaucourt Date: Tue, 27 Feb 2024 10:49:33 +0100 Subject: [PATCH] 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. --- integration-tests/src/tests/definition.test.ts | 2 +- integration-tests/src/utils/async.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/integration-tests/src/tests/definition.test.ts b/integration-tests/src/tests/definition.test.ts index 9e22e4093..639208759 100644 --- a/integration-tests/src/tests/definition.test.ts +++ b/integration-tests/src/tests/definition.test.ts @@ -37,7 +37,7 @@ suite('Bitbake Definition Test Suite', () => { position ) return definitionResult.length > 0 - }) + }, 5000) definitionResult.forEach((definition) => { const receivedUri = getDefinitionUri(definition) assert.equal(receivedUri.fsPath.endsWith(expectedPathEnding), true) diff --git a/integration-tests/src/utils/async.ts b/integration-tests/src/utils/async.ts index dbcb09cc4..7c8b2f6d2 100644 --- a/integration-tests/src/utils/async.ts +++ b/integration-tests/src/utils/async.ts @@ -13,10 +13,10 @@ 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, interval: number = 250, timeout: number = 300000): Promise { const startTime = Date.now() while (!(await predicate()) && (Date.now() - startTime < timeout)) { - await delay(250) + await delay(interval) } assert.ok(predicate()) }