diff --git a/test/parallel/test-stream-readable-async-iterators.js b/test/parallel/test-stream-readable-async-iterators.js index 2ee6680f27e331..9149058d1537fa 100644 --- a/test/parallel/test-stream-readable-async-iterators.js +++ b/test/parallel/test-stream-readable-async-iterators.js @@ -353,6 +353,22 @@ async function tests() { assert.strictEqual(received, 1); } + { + console.log('destroyed will not deadlock'); + const readable = new Readable(); + readable.destroy(); + process.nextTick(async () => { + readable.on('close', common.mustNotCall()); + let received = 0; + for await (const k of readable) { + // Just make linting pass. This should never run. + assert.strictEqual(k, 'hello'); + received++; + } + assert.strictEqual(received, 0); + }); + } + { console.log('push async'); const max = 42;