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>
This commit is contained in:
Rich Trott 2017-10-02 15:16:10 -07:00
parent ddbf07ab89
commit ad652afbe3

View File

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