Skip to content

Commit

Permalink
test: fix flaky async-hooks/test-tlswrap
Browse files Browse the repository at this point in the history
There is a race condition in async-hooks/test-tlswrap. This addresses it
by waiting 5 more ticks if the client has not been destroyed yet.

PR-URL: #15744
Fixes: #14404
Reviewed-By: Refael Ackermann <[email protected]>
  • Loading branch information
Trott authored and MylesBorins committed Oct 11, 2017
1 parent 22ea3a8 commit 1e79a06
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/async-hooks/test-tlswrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ function onsecureConnect() {
// TODO: why is client not destroyed here even after 5 ticks?
// or could it be that it isn't actually destroyed until
// the server is closed?
if (client.before.length < 3) {
tick(5, tick1);
return;
}
checkInvocations(client, { init: 1, before: 3, after: 3 },
'client: when client destroyed');
//
Expand Down

0 comments on commit 1e79a06

Please sign in to comment.