GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test,stream: fix pipeline test so it runs well on Windows in older nodes · nodejs/node@7794d4e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-stream-pipeline.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-stream-pipeline.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-stream-pipeline.js
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,13 @@ const { promisify } = require('util');
165165

166166
{
167167
const server = http.createServer((req, res) => {
168+
let sent = false;
168169
const rs = new Readable({
169170
read() {
171+
if (sent) {
172+
return;
173+
}
174+
sent = true;
170175
rs.push('hello');
171176
},
172177
destroy: common.mustCall((err, cb) => {
@@ -195,8 +200,12 @@ const { promisify } = require('util');
195200

196201
{
197202
const server = http.createServer((req, res) => {
203+
let sent = 0;
198204
const rs = new Readable({
199205
read() {
206+
if (sent++ > 10) {
207+
return;
208+
}
200209
rs.push('hello');
201210
},
202211
destroy: common.mustCall((err, cb) => {
@@ -242,8 +251,12 @@ const { promisify } = require('util');
242251
port: server.address().port
243252
});
244253

254+
let sent = 0;
245255
const rs = new Readable({
246256
read() {
257+
if (sent++ > 10) {
258+
return;
259+
}
247260
rs.push('hello');
248261
}
249262
});

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.