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.
This commit is contained in:
@@ -92,7 +92,7 @@ describe('WorkerCodeRuntime — programs and bindings (real workers)', () => {
|
|||||||
cursor = Array.isArray(cursor) ? cursor[0] : undefined
|
cursor = Array.isArray(cursor) ? cursor[0] : undefined
|
||||||
}
|
}
|
||||||
expect(cursor).toBe('leaf')
|
expect(cursor).toBe('leaf')
|
||||||
})
|
}, 15_000)
|
||||||
|
|
||||||
it('reports non-erasable syntax as an exception without spawning a worker', async () => {
|
it('reports non-erasable syntax as an exception without spawning a worker', async () => {
|
||||||
const { runtime } = await setup()
|
const { runtime } = await setup()
|
||||||
@@ -484,7 +484,9 @@ describe('WorkerCodeRuntime — hostile programs (real workers)', () => {
|
|||||||
const { parentPort } = await import('node:worker_threads');
|
const { parentPort } = await import('node:worker_threads');
|
||||||
let value = null;
|
let value = null;
|
||||||
for (let depth = 0; depth < 3_000; depth++) value = [value];
|
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: [],
|
bindings: [],
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user