GeezerVison is showing github.com — test: split out http2 from test-stream-pipeline · nodejs/node@a701dfb
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: test/parallel/parallel.status +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -12,6 +12,8 @@ test-net-connect-options-port: PASS,FLAKY | 12 | 12 | test-http2-pipe: PASS,FLAKY | 13 | 13 | test-worker-syntax-error: PASS,FLAKY | 14 | 14 | test-worker-syntax-error-file: PASS,FLAKY | | 15 | +# https://github.com/nodejs/node/issues/24456 | | 16 | +test-stream-pipeline-http2: PASS,FLAKY | 15 | 17 |
| 16 | 18 | [$system==linux] | 17 | 19 |
| |
Collapse file Copy file name to clipboard +36Lines changed: 36 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +'use strict'; | | 2 | + | | 3 | +const common = require('../common'); | | 4 | +if (!common.hasCrypto) | | 5 | + common.skip('missing crypto'); | | 6 | +const { Readable, pipeline } = require('stream'); | | 7 | +const http2 = require('http2'); | | 8 | + | | 9 | +{ | | 10 | + const server = http2.createServer((req, res) => { | | 11 | + pipeline(req, res, common.mustCall()); | | 12 | + }); | | 13 | + | | 14 | + server.listen(0, () => { | | 15 | + const url = `http://localhost:${server.address().port}`; | | 16 | + const client = http2.connect(url); | | 17 | + const req = client.request({ ':method': 'POST' }); | | 18 | + | | 19 | + const rs = new Readable({ | | 20 | + read() { | | 21 | + rs.push('hello'); | | 22 | + } | | 23 | + }); | | 24 | + | | 25 | + pipeline(rs, req, common.mustCall((err) => { | | 26 | + server.close(); | | 27 | + client.close(); | | 28 | + })); | | 29 | + | | 30 | + let cnt = 10; | | 31 | + req.on('data', (data) => { | | 32 | + cnt--; | | 33 | + if (cnt === 0) rs.destroy(); | | 34 | + }); | | 35 | + }); | | 36 | +} |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-stream-pipeline.js -32Lines changed: 0 additions & 32 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | 'use strict'; | 2 | 2 |
| 3 | 3 | const common = require('../common'); | 4 | | -if (!common.hasCrypto) | 5 | | - common.skip('missing crypto'); | 6 | 4 | const { Stream, Writable, Readable, Transform, pipeline } = require('stream'); | 7 | 5 | const assert = require('assert'); | 8 | 6 | const http = require('http'); | 9 | | -const http2 = require('http2'); | 10 | 7 | const { promisify } = require('util'); | 11 | 8 |
| 12 | 9 | { | @@ -275,35 +272,6 @@ const { promisify } = require('util'); | 275 | 272 | }); | 276 | 273 | } | 277 | 274 |
| 278 | | -{ | 279 | | - const server = http2.createServer((req, res) => { | 280 | | - pipeline(req, res, common.mustCall()); | 281 | | - }); | 282 | | - | 283 | | - server.listen(0, () => { | 284 | | - const url = `http://localhost:${server.address().port}`; | 285 | | - const client = http2.connect(url); | 286 | | - const req = client.request({ ':method': 'POST' }); | 287 | | - | 288 | | - const rs = new Readable({ | 289 | | - read() { | 290 | | - rs.push('hello'); | 291 | | - } | 292 | | - }); | 293 | | - | 294 | | - pipeline(rs, req, common.mustCall((err) => { | 295 | | - server.close(); | 296 | | - client.close(); | 297 | | - })); | 298 | | - | 299 | | - let cnt = 10; | 300 | | - req.on('data', (data) => { | 301 | | - cnt--; | 302 | | - if (cnt === 0) rs.destroy(); | 303 | | - }); | 304 | | - }); | 305 | | -} | 306 | | - | 307 | 275 | { | 308 | 276 | const makeTransform = () => { | 309 | 277 | const tr = new Transform({ | |
|