From f23f72524e37045e17adfc580beb3a27bd2938c2 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 10 Jul 2017 14:13:44 -0700 Subject: [PATCH] Handle ECONNRESET error in SimpleServer The ECONNRESET error is allowed to happen. We should handle it gracefully to not report travis builds as broken. --- test/SimpleServer.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/SimpleServer.js b/test/SimpleServer.js index 8b75081d..048ec9a1 100644 --- a/test/SimpleServer.js +++ b/test/SimpleServer.js @@ -120,6 +120,12 @@ class SimpleServer { } _onRequest(request, response) { + request.on('error', error => { + if (error.code === 'ECONNRESET') + response.end(); + else + throw error; + }); let pathName = url.parse(request.url).path; // Notify request subscriber. if (this._requestSubscribers.has(pathName))