Skip to content

Commit f90490d

Browse files
trivikrMylesBorins
authored andcommitted
test: http2 client operations after destroy
PR-URL: #18845 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent e1f8273 commit f90490d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/parallel/test-http2-client-destroy.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ const Countdown = require('../common/countdown');
5959
assert(socket.destroyed);
6060
}));
6161

62-
6362
const req = client.request();
6463
req.on('error', common.expectsError({
6564
code: 'ERR_HTTP2_STREAM_CANCEL',
@@ -77,15 +76,21 @@ const Countdown = require('../common/countdown');
7776
message: 'The session has been destroyed'
7877
};
7978

80-
common.expectsError(() => client.request(), sessionError);
79+
common.expectsError(() => client.setNextStreamID(), sessionError);
80+
common.expectsError(() => client.ping(), sessionError);
8181
common.expectsError(() => client.settings({}), sessionError);
82+
common.expectsError(() => client.goaway(), sessionError);
83+
common.expectsError(() => client.request(), sessionError);
8284
client.close(); // should be a non-op at this point
8385

8486
// Wait for setImmediate call from destroy() to complete
8587
// so that state.destroyed is set to true
8688
setImmediate(() => {
87-
common.expectsError(() => client.request(), sessionError);
89+
common.expectsError(() => client.setNextStreamID(), sessionError);
90+
common.expectsError(() => client.ping(), sessionError);
8891
common.expectsError(() => client.settings({}), sessionError);
92+
common.expectsError(() => client.goaway(), sessionError);
93+
common.expectsError(() => client.request(), sessionError);
8994
client.close(); // should be a non-op at this point
9095
});
9196

0 commit comments

Comments
 (0)