Skip to content

Commit

Permalink
test: fix flaky test-gc-net-timeout
Browse files Browse the repository at this point in the history
If the timeout is called in the time between 'end' and 'close'
that would cause a EPIPE error. Essentially making the test flaky.

PR-URL: nodejs#31918
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
ronag committed Mar 1, 2020
1 parent 11b7684 commit 1e8625c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/parallel/test-gc-net-timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ function serverHandler(sock) {
sock.on('close', function() {
clearTimeout(timer);
});
sock.on('end', function() {
clearTimeout(timer);
});
sock.on('error', function(err) {
assert.strictEqual(err.code, 'ECONNRESET');
});
Expand Down

0 comments on commit 1e8625c

Please sign in to comment.