From 9cdc0c34957afc760e037f83f6ba795a0bb81fe9 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 15 Jul 2026 06:14:54 -0700 Subject: [PATCH] test: tighten async polling intervals (#108301) --- src/commands/sessions-tail.test.ts | 2 +- src/infra/update-runner.test.ts | 2 +- test/openclaw-launcher.e2e.test.ts | 2 +- test/scripts/dev-tooling-safety.test.ts | 2 +- test/scripts/e2e-run-with-pty.test.ts | 2 +- test/scripts/pr-operation-lock.test.ts | 2 +- test/scripts/pr-prepare-gates.test.ts | 2 +- test/scripts/profile-extension-memory.test.ts | 2 +- test/scripts/run-with-env.test.ts | 2 +- test/scripts/secret-provider-integrations.test.ts | 2 +- test/scripts/telegram-user-credential.test.ts | 4 ++-- test/scripts/test-group-report.test.ts | 4 ++-- test/scripts/test-install-sh-docker.test.ts | 2 +- test/scripts/ui.test.ts | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/commands/sessions-tail.test.ts b/src/commands/sessions-tail.test.ts index 0f312fb7301..76aca9818ff 100644 --- a/src/commands/sessions-tail.test.ts +++ b/src/commands/sessions-tail.test.ts @@ -77,7 +77,7 @@ async function waitForRuntimeOutput( throw new Error(`Timed out waiting for output containing ${pattern}`); } await new Promise((resolve) => { - setTimeout(resolve, 25); + setTimeout(resolve, 5); }); } } diff --git a/src/infra/update-runner.test.ts b/src/infra/update-runner.test.ts index 895ab9dba34..56f574ea3ad 100644 --- a/src/infra/update-runner.test.ts +++ b/src/infra/update-runner.test.ts @@ -66,7 +66,7 @@ async function waitForProcessExit(pid: number, timeoutMs = 2_000): Promise((resolve) => { - setTimeout(resolve, 25); + setTimeout(resolve, 5); }); } return !isProcessAlive(pid); diff --git a/test/openclaw-launcher.e2e.test.ts b/test/openclaw-launcher.e2e.test.ts index 109372c9a9f..461445a2e85 100644 --- a/test/openclaw-launcher.e2e.test.ts +++ b/test/openclaw-launcher.e2e.test.ts @@ -88,7 +88,7 @@ async function waitForJsonFile(filePath: string, timeoutMs: number): Promise< } catch (error) { lastError = error; await new Promise((resolve) => { - setTimeout(resolve, 25); + setTimeout(resolve, 5); }); } } diff --git a/test/scripts/dev-tooling-safety.test.ts b/test/scripts/dev-tooling-safety.test.ts index 1b547d5a254..6fe27a2b8b8 100644 --- a/test/scripts/dev-tooling-safety.test.ts +++ b/test/scripts/dev-tooling-safety.test.ts @@ -36,7 +36,7 @@ async function waitForCondition(predicate: () => boolean, timeoutMs = 5_000): Pr return; } await new Promise((resolve) => { - setTimeout(resolve, 50); + setTimeout(resolve, 10); }); } throw new Error("timed out waiting for condition"); diff --git a/test/scripts/e2e-run-with-pty.test.ts b/test/scripts/e2e-run-with-pty.test.ts index 9580d50f2e0..6a0b1bba89d 100644 --- a/test/scripts/e2e-run-with-pty.test.ts +++ b/test/scripts/e2e-run-with-pty.test.ts @@ -194,7 +194,7 @@ async function waitFor(condition: () => boolean, timeoutMs = 3_000) { throw new Error("timed out waiting for condition"); } await new Promise((resolve) => { - setTimeout(resolve, 25); + setTimeout(resolve, 5); }); } } diff --git a/test/scripts/pr-operation-lock.test.ts b/test/scripts/pr-operation-lock.test.ts index 07d1ba8c273..64b9bbbee97 100644 --- a/test/scripts/pr-operation-lock.test.ts +++ b/test/scripts/pr-operation-lock.test.ts @@ -289,7 +289,7 @@ async function waitFor(predicate: () => boolean, timeoutMs = 5000) { if (predicate()) { return true; } - await new Promise((resolve) => setTimeout(resolve, 25)); + await new Promise((resolve) => setTimeout(resolve, 5)); } return false; } diff --git a/test/scripts/pr-prepare-gates.test.ts b/test/scripts/pr-prepare-gates.test.ts index 7c9d39bc3a4..6e3271098af 100644 --- a/test/scripts/pr-prepare-gates.test.ts +++ b/test/scripts/pr-prepare-gates.test.ts @@ -193,7 +193,7 @@ async function waitFor(predicate: () => boolean, timeoutMs: number): Promise setTimeout(resolve, 50)); + await new Promise((resolve) => setTimeout(resolve, 10)); } return predicate(); } diff --git a/test/scripts/profile-extension-memory.test.ts b/test/scripts/profile-extension-memory.test.ts index e3f1286b44d..c43fbb12830 100644 --- a/test/scripts/profile-extension-memory.test.ts +++ b/test/scripts/profile-extension-memory.test.ts @@ -17,7 +17,7 @@ async function waitForCondition(predicate: () => boolean, timeoutMs = 5_000): Pr return; } await new Promise((resolve) => { - setTimeout(resolve, 50); + setTimeout(resolve, 10); }); } throw new Error("timed out waiting for condition"); diff --git a/test/scripts/run-with-env.test.ts b/test/scripts/run-with-env.test.ts index 5caa83200c8..2f5d594b544 100644 --- a/test/scripts/run-with-env.test.ts +++ b/test/scripts/run-with-env.test.ts @@ -43,7 +43,7 @@ async function waitFor(predicate: () => boolean, label: string, timeoutMs = 3_00 throw new Error(`timed out waiting for ${label}`); } await new Promise((resolve) => { - setTimeout(resolve, 25); + setTimeout(resolve, 5); }); } } diff --git a/test/scripts/secret-provider-integrations.test.ts b/test/scripts/secret-provider-integrations.test.ts index 4902ea70c6c..8d97d3b5204 100644 --- a/test/scripts/secret-provider-integrations.test.ts +++ b/test/scripts/secret-provider-integrations.test.ts @@ -28,7 +28,7 @@ async function waitFor(predicate: () => boolean, timeoutMs = 5_000): Promise { - setTimeout(resolve, 25); + setTimeout(resolve, 5); }); } throw new Error("condition was not met before timeout"); diff --git a/test/scripts/telegram-user-credential.test.ts b/test/scripts/telegram-user-credential.test.ts index 297cae2bcd8..14785f4e382 100644 --- a/test/scripts/telegram-user-credential.test.ts +++ b/test/scripts/telegram-user-credential.test.ts @@ -46,7 +46,7 @@ async function waitForFile(filePath: string, timeoutMs: number): Promise { return; } await new Promise((resolve) => { - setTimeout(resolve, 25); + setTimeout(resolve, 5); }); } throw new Error(`timeout waiting for ${filePath}`); @@ -59,7 +59,7 @@ async function waitForDead(pid: number, timeoutMs: number): Promise { return; } await new Promise((resolve) => { - setTimeout(resolve, 25); + setTimeout(resolve, 5); }); } throw new Error(`process still alive: ${pid}`); diff --git a/test/scripts/test-group-report.test.ts b/test/scripts/test-group-report.test.ts index 0b2aaec8675..850c7923b26 100644 --- a/test/scripts/test-group-report.test.ts +++ b/test/scripts/test-group-report.test.ts @@ -53,7 +53,7 @@ async function waitForFile(filePath: string, timeoutMs: number): Promise { if (fs.existsSync(filePath)) { return; } - await sleep(25); + await sleep(5); } throw new Error(`timed out waiting for ${filePath}`); } @@ -64,7 +64,7 @@ async function waitForDead(pid: number, timeoutMs: number): Promise { if (!isProcessAlive(pid)) { return; } - await sleep(25); + await sleep(5); } throw new Error(`timed out waiting for pid ${pid} to exit`); } diff --git a/test/scripts/test-install-sh-docker.test.ts b/test/scripts/test-install-sh-docker.test.ts index be5dfa5dfb9..ede9255a908 100644 --- a/test/scripts/test-install-sh-docker.test.ts +++ b/test/scripts/test-install-sh-docker.test.ts @@ -234,7 +234,7 @@ async function waitForCondition( if (predicate()) { return; } - await new Promise((resolve) => setTimeout(resolve, 25)); + await new Promise((resolve) => setTimeout(resolve, 5)); } throw new Error(`timed out waiting for ${label}`); } diff --git a/test/scripts/ui.test.ts b/test/scripts/ui.test.ts index e3517f25266..33c26c8b4bd 100644 --- a/test/scripts/ui.test.ts +++ b/test/scripts/ui.test.ts @@ -18,7 +18,7 @@ async function waitFor(predicate: () => boolean, label: string, timeoutMs = 3_00 throw new Error(`timed out waiting for ${label}`); } await new Promise((resolve) => { - setTimeout(resolve, 25); + setTimeout(resolve, 5); }); } }