Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test,stream: fix pipeline test so it runs well on Windows in older nodes
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
  • Loading branch information
mcollina committed Aug 22, 2018
commit 1f7c87fc1b4bd91462d5cb8a1b6785f46cec12b1
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