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: remove dead code in test-http2-misbehaving-multiplex · nodejs/node@7b7687e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-http2-misbehaving-multiplex.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-http2-misbehaving-multiplex.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-misbehaving-multiplex.js
+7-24Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,18 @@ const h2 = require('http2');
1111
const net = require('net');
1212
const { NghttpError } = require('internal/http2/util');
1313
const h2test = require('../common/http2');
14-
let client;
1514

1615
const server = h2.createServer();
17-
let gotFirstStreamId1;
1816
server.on('stream', common.mustCall((stream) => {
1917
stream.respond();
2018
stream.end('ok');
2119

22-
// Http2Server should be fast enough to respond to and close
23-
// the first streams with ID 1 and ID 3 without errors.
24-
25-
// Test for errors in 'close' event to ensure no errors on some streams.
26-
stream.on('error', () => {});
27-
stream.on('close', (err) => {
28-
if (stream.id === 1) {
29-
if (gotFirstStreamId1) {
30-
// We expect our outgoing frames to fail on Stream ID 1 the second time
31-
// because a stream with ID 1 was already closed before.
32-
common.expectsError({
33-
constructor: NghttpError,
34-
code: 'ERR_HTTP2_ERROR',
35-
message: 'Stream was already closed or invalid'
36-
});
37-
return;
38-
}
39-
gotFirstStreamId1 = true;
40-
}
41-
assert.strictEqual(err, undefined);
42-
});
20+
stream.on('error', common.expectsError({
21+
code: 'ERR_HTTP2_ERROR',
22+
constructor: NghttpError,
23+
message: 'Stream was already closed or invalid'
24+
}));
25+
stream.on('close', common.mustCall());
4326

4427
// Stream ID 5 should never reach the server
4528
assert.notStrictEqual(stream.id, 5);
@@ -62,7 +45,7 @@ const id3 = new h2test.HeadersFrame(3, h2test.kFakeRequestHeaders, 0, true);
6245
const id5 = new h2test.HeadersFrame(5, h2test.kFakeRequestHeaders, 0, true);
6346

6447
server.listen(0, () => {
65-
client = net.connect(server.address().port, () => {
48+
const client = net.connect(server.address().port, () => {
6649
client.write(h2test.kClientMagic, () => {
6750
client.write(settings.data, () => {
6851
client.write(settingsAck.data);

0 commit comments

Comments
0 (0)
You are visitor 01402503 — 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.