From b56b64a55fa94aef1f65ad88e6868fbd9d94a170 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat Date: Sat, 7 Oct 2017 18:58:44 -0700 Subject: [PATCH] test: http2 connectionListener reject client This code change modifies connectionListener tests to cover test case where this.emit('unknownProtocol', socket) returns false Refs: https://github.com/nodejs/node/issues/14985 --- test/parallel/test-http2-https-fallback.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-http2-https-fallback.js b/test/parallel/test-http2-https-fallback.js index 4dabe4e69db780..04e9ca480c9099 100644 --- a/test/parallel/test-http2-https-fallback.js +++ b/test/parallel/test-http2-https-fallback.js @@ -110,9 +110,9 @@ function onSession(session) { common.mustCall(onRequest) ); - server.on('unknownProtocol', common.mustCall((socket) => { + server.once('unknownProtocol', common.mustCall((socket) => { socket.destroy(); - }, 2)); + })); server.listen(0);