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: nodejs#4979
Reviewed-By: Brian White <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
santigimeno authored and Michael Scovetta committed Apr 2, 2016
1 parent d1577bb commit 1da4c02
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 1da4c02

Please sign in to comment.