From bfdf20729df07e7c31b6fba1526681f8e2b4f91d Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Fri, 11 Sep 2026 13:32:55 +0200 Subject: [PATCH] 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 Assisted-by: Codex PR-URL: https://github.com/nodejs/node/pull/65980 Reviewed-By: James M Snell Reviewed-By: LiviaMedeiros --- test/parallel/test-stream-iter-broadcast-from.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-stream-iter-broadcast-from.js b/test/parallel/test-stream-iter-broadcast-from.js index 39d92c2aef4..928d4d472f0 100644 --- a/test/parallel/test-stream-iter-broadcast-from.js +++ b/test/parallel/test-stream-iter-broadcast-from.js @@ -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; }