From 4bc4b5d2a7f0db2b21a06650eaef6a9d664d5d04 Mon Sep 17 00:00:00 2001 From: sangwook Date: Sat, 14 Feb 2026 07:32:45 +0900 Subject: [PATCH] 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: https://github.com/nodejs/node/issues/33156 --- test/parallel/test-http2-close-while-writing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-http2-close-while-writing.js b/test/parallel/test-http2-close-while-writing.js index c0a05c4a8da21a..01ba1c9f7b0b89 100644 --- a/test/parallel/test-http2-close-while-writing.js +++ b/test/parallel/test-http2-close-while-writing.js @@ -38,7 +38,7 @@ server.listen(0, common.mustCall(() => { }); client_stream = client.request({ ':method': 'POST' }); client_stream.on('close', common.mustCall(() => { - client.close(); + client.destroy(); server.close(); })); client_stream.resume();