Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Nov 19, 2021
1 parent a4a677e commit 2930afa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/internal/streams/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ function pipelineImpl(streams, callback, opts) {

if (isNodeStream(stream)) {
finishCount++;
destroys.push(destroyer(stream, reading, writing, (err) => {
destroys.push(destroyer(stream, reading, end && writing, (err) => {
if (!err && !reading && isReadableFinished(stream, false)) {
stream.read(0);
destroyer(stream, true, writing, finish);
Expand Down
23 changes: 22 additions & 1 deletion test/parallel/test-stream-pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -1465,5 +1465,26 @@ const tsp = require('timers/promises');
assert.strictEqual(duplex.destroyed, true);
}

run();
run().then(common.mustCall());
}

{
const pipelinePromise = promisify(pipeline);

async function run() {
const read = new Readable({
read() {}
});

const duplex = new PassThrough();

read.push(null);

await pipelinePromise(read, duplex, { end: false });

assert.strictEqual(duplex.destroyed, false);
assert.strictEqual(duplex.writableEnded, false);
}

run().then(common.mustCall());
}

0 comments on commit 2930afa

Please sign in to comment.