Skip to content

Commit d625384

Browse files
ronagcodebytere
authored andcommitted
test: fix flaky test-gc-net-timeout
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 <[email protected]>
1 parent f9113fd commit d625384

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎test/parallel/test-gc-net-timeout.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ function serverHandler(sock){
1212
sock.on('close',function(){
1313
clearTimeout(timer);
1414
});
15+
sock.on('end',function(){
16+
clearTimeout(timer);
17+
});
1518
sock.on('error',function(err){
1619
assert.strictEqual(err.code,'ECONNRESET');
1720
});

0 commit comments

Comments
(0)