From 3cc725d9c6b8ed3834abd9c6a7ef44a89d02d012 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 PR-URL: https://github.com/nodejs/node/pull/16080 Ref: https://github.com/nodejs/node/issues/14985 Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- 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 4dabe4e69d..04e9ca480c 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);