From e4fc079080d52fe07d26511a696d452e28126dbb Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Sat, 30 Jan 2016 20:55:07 +0100 Subject: [PATCH] test: fix test-http-extra-response flakiness It can happen that the extra response is to be sent in a different chunk from the rest of the data. At this moment, the client might have already closed the socket causing an `ECONNRESET` error. PR-URL: https://github.com/nodejs/node/pull/4979 Reviewed-By: Brian White Reviewed-By: James M Snell --- test/parallel/test-http-extra-response.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/parallel/test-http-extra-response.js b/test/parallel/test-http-extra-response.js index bfd9b59462..fc398b9175 100644 --- a/test/parallel/test-http-extra-response.js +++ b/test/parallel/test-http-extra-response.js @@ -37,6 +37,10 @@ var server = net.createServer(function(socket) { socket.end(fullResponse); } }); + + socket.on('error', function(err) { + assert.equal(err.code, 'ECONNRESET'); + }); });