Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: unflake har tests (#4335)

Dmitry Gozman12afb79e7396
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));