From 6a13dcb364caec44ee9615f46cfa952729049dea Mon Sep 17 00:00:00 2001 From: kingwl Date: Fri, 10 Jul 2026 03:11:40 +0800 Subject: [PATCH] test(workflow): give the wedged-child waitFors loaded-runner headroom The three wedged-child scenarios busy-spin their worker for 1.5s while the host waits for the start RPC; under a loaded 2-core CI runner (this branch adds several parallel suites) the RPC lands after vi.waitFor default 1s, failing the coverage lane three runs in a row at the same three sites. An explicit 10s waitFor timeout (well inside each test own 15s budget) makes the assertions load-tolerant without weakening them. Belongs upstream with dsh-workflow-workerthread; carried here because it gates this PR. --- .../tests/workflow-workerthread.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/workflow/workflow-workerthread/tests/workflow-workerthread.spec.ts b/packages/workflow/workflow-workerthread/tests/workflow-workerthread.spec.ts index ecaeed61f6..38a5435b69 100644 --- a/packages/workflow/workflow-workerthread/tests/workflow-workerthread.spec.ts +++ b/packages/workflow/workflow-workerthread/tests/workflow-workerthread.spec.ts @@ -602,7 +602,7 @@ describe('dsh-workflow-workerthread', () => { `), parent, }) - await vi.waitFor(() => { expect(provider.runs.length).toBe(1) }) + await vi.waitFor(() => { expect(provider.runs.length).toBe(1) }, { timeout: 10_000 }) const before = Date.now() await handle.dispose() // Bounded by the grace (plus the terminate), never by the 1.5s spin. @@ -625,7 +625,7 @@ describe('dsh-workflow-workerthread', () => { `), parent, }) - await vi.waitFor(() => { expect(provider.runs.length).toBe(1) }) + await vi.waitFor(() => { expect(provider.runs.length).toBe(1) }, { timeout: 10_000 }) const handleDispose = handle.dispose() const result = await handle.result // The script itself settled (the wrapper's own dispose RPC found the @@ -663,7 +663,7 @@ describe('dsh-workflow-workerthread', () => { `), parent, }) - await vi.waitFor(() => { expect(order.filter(entry => entry.startsWith('start:')).length).toBe(2) }) + await vi.waitFor(() => { expect(order.filter(entry => entry.startsWith('start:')).length).toBe(2) }, { timeout: 10_000 }) const fast = provider.runs.find(run => (run.request.prompt[0] as { text?: string }).text === 'fast')! fast.settle(text('fast done')) handle.cancel('stop now')