Skip to content

Commit b685d7d

Browse files
lpincatargos
authored andcommitted
test: deflake test-http-dump-req-when-res-ends.js
On some platforms the `'end'` event might not be emitted because the socket could be destroyed by the other peer while the client is still sending the data triggering an error. Use the `'close'` event instead. PR-URL: #30360 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 1ef1f4f commit b685d7d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

test/parallel/parallel.status

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ test-worker-memory: PASS,FLAKY
1919
test-http2-client-upload: PASS,FLAKY
2020
# https://github.com/nodejs/node/issues/20750
2121
test-http2-client-upload-reject: PASS,FLAKY
22-
# https://github.com/nodejs/node/issues/30011
23-
test-http-dump-req-when-res-ends: PASS,FLAKY
2422

2523
[$system==linux]
2624

test/parallel/test-http-dump-req-when-res-ends.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ server.listen(0, mustCall(function() {
4848

4949
res.resume();
5050

51-
// Wait for the response.
52-
res.on('end', function() {
51+
// On some platforms the `'end'` event might not be emitted because the
52+
// socket could be destroyed by the other peer while data is still being
53+
// sent. In this case the 'aborted'` event is emitted instead of `'end'`.
54+
// `'close'` is used here because it is always emitted and does not
55+
// invalidate the test.
56+
res.on('close', function() {
5357
server.close();
5458
});
5559
}));

0 commit comments

Comments
 (0)