Skip to content

Commit 0d4e74c

Browse files
committed
update not-blocking.js for Node 20 on Mac
1 parent cddc499 commit 0d4e74c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/not-blocking.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ for (const [title, brokerOpts, subscription] of
8282
const publish = () => {
8383
if (sent === total) {
8484
publisher.end()
85-
subscriber.end()
85+
// Node 20 on Mac needs more time to complete
86+
// hence the setImmediate
87+
setImmediate(() => subscriber.end())
8688
} else {
8789
sent++
8890
publisher.publish('test', 'payload', () => setImmediate(publish))

0 commit comments

Comments
 (0)