From 06dd2a967d44d8e3f56023853d0bdb16e286faba Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Sun, 17 May 2026 13:08:10 -0700 Subject: [PATCH] test: make http2 close-while-writing single-shot The test only needs one request data chunk to queue the server write and destroy the client stream. Using a persistent data listener can queue multiple writes and multiple destroys from the same request body, which makes the test occasionally hang until the harness timeout. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 --- 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..abfdf26c3e71f0 100644 --- a/test/parallel/test-http2-close-while-writing.js +++ b/test/parallel/test-http2-close-while-writing.js @@ -24,7 +24,7 @@ let client_stream; server.on('session', common.mustCall(function(session) { session.on('stream', common.mustCall(function(stream) { stream.resume(); - stream.on('data', function() { + stream.once('data', function() { this.write(Buffer.alloc(1)); process.nextTick(() => client_stream.destroy()); });