From 12afb79e739621a1906e47e215d3131a50137490 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Wed, 4 Nov 2020 10:24:01 -0800 Subject: [PATCH] test: unflake har tests (#4335) Our test server throws Parse Error when connection aborts at unfortunate time. --- utils/testserver/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/utils/testserver/index.js b/utils/testserver/index.js index 3f5773b1e1..9927d6d0ea 100644 --- a/utils/testserver/index.js +++ b/utils/testserver/index.js @@ -89,15 +89,14 @@ class TestServer { this.PREFIX = `${protocol}://localhost:${port}`; this.CROSS_PROCESS_PREFIX = `${protocol}://127.0.0.1:${port}`; this.EMPTY_PAGE = `${protocol}://localhost:${port}/empty.html`; - } _onSocket(socket) { this._sockets.add(socket); - // ECONNRESET is a legit error given - // that tab closing simply kills process. + // ECONNRESET and HPE_INVALID_EOF_STATE are legit errors given + // that tab closing aborts outgoing connections to the server. socket.on('error', error => { - if (error.code !== 'ECONNRESET') + if (error.code !== 'ECONNRESET' && error.code !== 'HPE_INVALID_EOF_STATE') throw error; }); socket.once('close', () => this._sockets.delete(socket));