From a2cddb4dca2c4dda238eb83ba9e4bcebeb91e7f7 Mon Sep 17 00:00:00 2001 From: amosblomqvist Date: Mon, 5 Oct 2026 04:58:00 +0300 Subject: [PATCH] =?UTF-8?q?tests:=20waitFor=20budget=208s=20=E2=86=92=2030?= =?UTF-8?q?s=20=E2=80=94=20the=20jobs-suite=20flake=20under=20full-suite?= =?UTF-8?q?=20load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Under npm test's parallel load the event loop starves and the 8s wall-clock budget expired before healthy conditions were ever observed; a timed-out delivery then leaked a late wake into the NEXT test (the respawn hook is module-global), poisoning even synchronous neighbors — the recurring double-run-guard / recovery-sweep failures. waitFor returns the instant the condition holds, so the generous budget costs nothing when healthy. Full suite 1326/1326. --- tests/jobs.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/jobs.test.ts b/tests/jobs.test.ts index 7a0c0e5..1366378 100644 --- a/tests/jobs.test.ts +++ b/tests/jobs.test.ts @@ -184,7 +184,13 @@ function post(chatId: string, input: unknown): Request { }); } -function waitFor(cond: () => boolean, timeoutMs = 8000, what = "condition"): Promise { +/* 30s budget (owner round, 2026-10-05): under the FULL suite's parallel + * load the event loop starves and an 8s wall-clock budget expired before + * healthy conditions were ever observed — and a timed-out delivery leaked + * a late wake into the NEXT test (the respawn hook is module-global), + * poisoning even synchronous neighbors. waitFor returns the instant the + * condition holds, so the generous budget costs nothing when healthy. */ +function waitFor(cond: () => boolean, timeoutMs = 30_000, what = "condition"): Promise { return new Promise((resolve, reject) => { const started = Date.now(); const tick = () => {