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 committed Oct 5, 2017
1 parent ddbf07a commit ad652af
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 ad652af

Please sign in to comment.