Skip to content

Commit 06dd2a9

Browse files
committed
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
1 parent 5a8882a commit 06dd2a9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ let client_stream;
2424
server.on('session', common.mustCall(function(session) {
2525
session.on('stream', common.mustCall(function(stream) {
2626
stream.resume();
27-
stream.on('data', function() {
27+
stream.once('data', function() {
2828
this.write(Buffer.alloc(1));
2929
process.nextTick(() => client_stream.destroy());
3030
});

0 commit comments

Comments
 (0)