Skip to content

Commit 4bc4b5d

Browse files
committed
test: fix flaky test-http2-close-while-writing
The test was flaky due to a race condition where `client.close()` would wait for a graceful shutdown while the server had already destroyed the session/stream, leading to a timeout. Changes: - Replace `client.close()` with `client.destroy()` in the `close` event handler of the client stream. Refs: #33156
1 parent 3d30c30 commit 4bc4b5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/parallel/test-http2-close-while-writing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ server.listen(0, common.mustCall(() => {
3838
});
3939
client_stream = client.request({ ':method': 'POST' });
4040
client_stream.on('close', common.mustCall(() => {
41-
client.close();
41+
client.destroy();
4242
server.close();
4343
}));
4444
client_stream.resume();

0 commit comments

Comments
 (0)