From 0852d5ab63b0a24ae2ca2edf91792f10377a3322 Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Wed, 22 Jul 2026 18:24:36 +0800 Subject: [PATCH] test: stabilize deep Code Mode worker coverage Give the real-worker binding stress case an explicit CI budget and keep the forged-completion program pending so bootstrap cannot publish a competing normal completion. --- .../code-runtime/code-runtime-worker/tests/runtime.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/code-runtime/code-runtime-worker/tests/runtime.spec.ts b/packages/code-runtime/code-runtime-worker/tests/runtime.spec.ts index c4dfefff91..bae0c3d4a6 100644 --- a/packages/code-runtime/code-runtime-worker/tests/runtime.spec.ts +++ b/packages/code-runtime/code-runtime-worker/tests/runtime.spec.ts @@ -92,7 +92,7 @@ describe('WorkerCodeRuntime — programs and bindings (real workers)', () => { cursor = Array.isArray(cursor) ? cursor[0] : undefined } expect(cursor).toBe('leaf') - }) + }, 15_000) it('reports non-erasable syntax as an exception without spawning a worker', async () => { const { runtime } = await setup() @@ -484,7 +484,9 @@ describe('WorkerCodeRuntime — hostile programs (real workers)', () => { const { parentPort } = await import('node:worker_threads'); let value = null; for (let depth = 0; depth < 3_000; depth++) value = [value]; - parentPort.postMessage({ type: 'done', value }); + setTimeout(() => { parentPort.postMessage({ type: 'done', value }) }, 25); + // Prevent bootstrap's normal undefined completion from racing the forged terminal. + await new Promise(() => {}); `, bindings: [], })