Browse Source

test: fix flaky async-hooks/test-tlswrap

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: https://github.com/nodejs/node/pull/15744
Fixes: https://github.com/nodejs/node/issues/14404
Reviewed-By: Refael Ackermann <refack@gmail.com>
v9.x-staging
Rich Trott 7 years ago
parent
commit
ad652afbe3
  1. 4
      test/async-hooks/test-tlswrap.js

4
test/async-hooks/test-tlswrap.js

@ -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');
//

Loading…
Cancel
Save