Skip to content

Commit 78e9d47

Browse files
committed
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: #65980 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: LiviaMedeiros <livia@cirno.name>
1 parent c109c85 commit 78e9d47

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

test/parallel/test-stream-iter-broadcast-from.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ async function testBroadcastFromCancelWhileBlocked() {
122122
async function* slowSource() {
123123
const enc = new TextEncoder();
124124
yield [enc.encode('chunk1')];
125-
// Simulate a long delay - the cancel should unblock this
126-
await new Promise((resolve) => setTimeout(resolve, 10000));
125+
// Simulate a long delay without keeping the cancelled source alive.
126+
await new Promise((resolve) => setTimeout(resolve, 10000).unref());
127127
yield [enc.encode('chunk2')];
128128
sourceFinished = true;
129129
}

0 commit comments

Comments
 (0)