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()); });