mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
test: unref cancelled broadcast source timer
The source delay should not keep the process alive after cancellation. Keep the blocked-source cancellation assertions and unref its timer. Signed-off-by: Filip Skokan <panva.ip@gmail.com> Assisted-by: Codex PR-URL: https://github.com/nodejs/node/pull/65980 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: LiviaMedeiros <livia@cirno.name>
This commit is contained in:
1 parent
b29154d471
commit
bfdf20729d
1 file changed
+2
-2
@@ -122,8 +122,8 @@ async function testBroadcastFromCancelWhileBlocked() {
|
||||
async function* slowSource() {
|
||||
const enc = new TextEncoder();
|
||||
yield [enc.encode('chunk1')];
|
||||
// Simulate a long delay - the cancel should unblock this
|
||||
await new Promise((resolve) => setTimeout(resolve, 10000));
|
||||
// Simulate a long delay without keeping the cancelled source alive.
|
||||
await new Promise((resolve) => setTimeout(resolve, 10000).unref());
|
||||
yield [enc.encode('chunk2')];
|
||||
sourceFinished = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user