Skip to content

Commit 02c2396

Browse files
addaleaxcodebytere
authored andcommitted
test: fix flaky test-http2-stream-destroy-event-order
Alternative to #31590. It appears that the issue here is that the test falsely assumed that closing the client (which also currently destroys the socket rather than gracefully shutting down the connection) would still leave enough time for the server side to receive the stream error. Address that by explicitly waiting for the server side to receive the stream error before closing the client and the connection with it. Refs: #31590 Refs: #20750 PR-URL: #31610 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent c892d41 commit 02c2396

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

test/parallel/parallel.status

-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ test-http2-multistream-destroy-on-read-tls: PASS,FLAKY
2222
# https://github.com/nodejs/node/issues/20750
2323
test-http2-pipe: PASS,FLAKY
2424
# https://github.com/nodejs/node/issues/20750
25-
# https://github.com/nodejs/node/pull/31590
26-
test-http2-stream-destroy-event-order: PASS,FLAKY
27-
# https://github.com/nodejs/node/issues/20750
2825
test-stream-pipeline-http2: PASS,FLAKY
2926
# https://github.com/nodejs/node/issues/24497
3027
test-timers-immediate-queue: PASS,FLAKY

test/parallel/test-http2-stream-destroy-event-order.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ let req;
1010
const server = http2.createServer();
1111
server.on('stream', common.mustCall((stream) => {
1212
stream.on('error', common.mustCall(() => {
13+
client.close();
1314
stream.on('close', common.mustCall(() => {
1415
server.close();
1516
}));
@@ -22,8 +23,6 @@ server.listen(0, common.mustCall(() => {
2223
req = client.request();
2324
req.resume();
2425
req.on('error', common.mustCall(() => {
25-
req.on('close', common.mustCall(() => {
26-
client.close();
27-
}));
26+
req.on('close', common.mustCall());
2827
}));
2928
}));

0 commit comments

Comments
 (0)