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: #31918
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
ronag authored and codebytere committed Mar 3, 2020
1 parent 3bd8fea commit 3849474
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 3849474

Please sign in to comment.