Skip to content

Commit

Permalink
test,stream: fix pipeline test so it runs well on Windows in older nodes
Browse files Browse the repository at this point in the history
This test is ported automatically in readable-stream, and it fails there
on Windows and older Node.js versions because of some bad interactions
between the code and the event loop on Windows.

See: nodejs/readable-stream#353

PR-URL: #22456
Reviewed-By: Mathias Buus <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
mcollina authored and targos committed Sep 3, 2018
1 parent e254130 commit 7794d4e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/parallel/test-stream-pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,13 @@ const { promisify } = require('util');

{
const server = http.createServer((req, res) => {
let sent = false;
const rs = new Readable({
read() {
if (sent) {
return;
}
sent = true;
rs.push('hello');
},
destroy: common.mustCall((err, cb) => {
Expand Down Expand Up @@ -195,8 +200,12 @@ const { promisify } = require('util');

{
const server = http.createServer((req, res) => {
let sent = 0;
const rs = new Readable({
read() {
if (sent++ > 10) {
return;
}
rs.push('hello');
},
destroy: common.mustCall((err, cb) => {
Expand Down Expand Up @@ -242,8 +251,12 @@ const { promisify } = require('util');
port: server.address().port
});

let sent = 0;
const rs = new Readable({
read() {
if (sent++ > 10) {
return;
}
rs.push('hello');
}
});
Expand Down

0 comments on commit 7794d4e

Please sign in to comment.