Skip to content

Commit

Permalink
fix a test
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak committed May 26, 2024
1 parent fdd617c commit 8d9a13c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ added: v8.4.0
due to an error.
* `code` {number} The HTTP/2 error code to send in the final `GOAWAY` frame.
If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`,
otherwise defaults to `NO_ERROR`.
otherwise defaults to `CANCEL`.

Immediately terminates the `Http2Session` and the associated `net.Socket` or
`tls.TLSSocket`.
Expand Down
12 changes: 5 additions & 7 deletions test/parallel/test-http2-server-socket-destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,11 @@ server.on('listening', common.mustCall(async () => {
client.on('close', common.mustCall());

const req = client.request({ ':method': 'POST' });
// The client may have an ECONNRESET error here depending on the operating
// system, due mainly to differences in the timing of socket closing. Do
// not wrap this in a common mustCall.
req.on('error', (err) => {
if (err.code !== 'ECONNRESET')
throw err;
});
req.on('error', common.expectsError({
name: 'Error',
code: 'ERR_HTTP2_STREAM_ERROR',
message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR'
}));

req.on('aborted', common.mustCall());
req.resume();
Expand Down

0 comments on commit 8d9a13c

Please sign in to comment.