Skip to content

Commit

Permalink
test: fix test-http-extra-response flakiness
Browse files Browse the repository at this point in the history
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: #4979
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
santigimeno authored and rvagg committed Feb 8, 2016
1 parent 725ad5b commit c3d9329
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/parallel/test-http-extra-response.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ var server = net.createServer(function(socket) {
socket.end(fullResponse);
}
});

socket.on('error', function(err) {
assert.equal(err.code, 'ECONNRESET');
});
});


Expand Down

0 comments on commit c3d9329

Please sign in to comment.