Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions test/parallel/test-http2-client-destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ const Countdown = require('../common/countdown');
assert(socket.destroyed);
}));


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

common.expectsError(() => client.request(), sessionError);
common.expectsError(() => client.setNextStreamID(), sessionError);
common.expectsError(() => client.ping(), sessionError);
common.expectsError(() => client.settings({}), sessionError);
common.expectsError(() => client.goaway(), sessionError);
common.expectsError(() => client.request(), sessionError);
client.close(); // should be a non-op at this point

// Wait for setImmediate call from destroy() to complete
// so that state.destroyed is set to true
setImmediate(() => {
common.expectsError(() => client.request(), sessionError);
common.expectsError(() => client.setNextStreamID(), sessionError);
common.expectsError(() => client.ping(), sessionError);
common.expectsError(() => client.settings({}), sessionError);
common.expectsError(() => client.goaway(), sessionError);
common.expectsError(() => client.request(), sessionError);
client.close(); // should be a non-op at this point
});

Expand Down