From 02787ce5d1605e2360ecc50c0b46b9e45463a6fb Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sat, 3 Oct 2020 19:32:32 +0200 Subject: [PATCH] test: add ALPNProtocols option to clientOptions Without this, the session is destroyed with the following error ``` Error [ERR_HTTP2_ERROR]: Protocol error at Http2Session.onSessionInternalError (internal/http2/core.js:756:26) Emitted 'error' event on ClientHttp2Session instance at: at emitClose (internal/http2/core.js:1010:10) at internal/http2/core.js:1048:7 at finish (internal/streams/writable.js:731:5) at processTicksAndRejections (internal/process/task_queues.js:80:21) { code: 'ERR_HTTP2_ERROR', errno: -505 } ``` The test then calls `session.close()` which tries to write to a destroyed socket. As a result, an unhandled `ECONNRESET` error is emitted in the v12 release line. Backport-PR-URL: https://github.com/nodejs/node/pull/34859 PR-URL: https://github.com/nodejs/node/pull/35482 Refs: https://github.com/nodejs/node/pull/34859 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- test/parallel/test-http2-connect.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/parallel/test-http2-connect.js b/test/parallel/test-http2-connect.js index 9ee2e4347f600b..9b4055373f25bd 100644 --- a/test/parallel/test-http2-connect.js +++ b/test/parallel/test-http2-connect.js @@ -95,6 +95,7 @@ const { connect: tlsConnect } = require('tls'); }; const clientOptions = { + ALPNProtocols: ['h2'], port, rejectUnauthorized: false };