Skip to content

Commit 5368aa9

Browse files
committed
test(web): abort the reap bound once the child exited
The ref'd 5 s timer kept the suite alive after the race settled, so every run of the file paid 5 s. It is aborted once the child exits; the bound still fires while the race is open.
1 parent 21056b1 commit 5368aa9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎test/integration/smoke-web-platform.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@ test('web shutdown cleanup reaps the exact daemon that survived graceful shutdow
104104
'expected cleanup to escalate after the child ignored SIGTERM',
105105
);
106106
// The killed child stays a zombie, alive to kill(pid, 0), until this process reaps it on exit.
107-
await Promise.race([exited, delay(5_000)]);
107+
const bound = new AbortController();
108+
await Promise.race([
109+
exited,
110+
delay(5_000, undefined, { signal: bound.signal }).catch(() => undefined),
111+
]);
112+
bound.abort();
108113
assert.equal(isProcessAlive(daemonPid), false);
109114
});
110115

0 commit comments

Comments
 (0)