Skip to content

Commit 1e79a06

Browse files
TrottMylesBorins
authored andcommitted
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: #15744 Fixes: #14404 Reviewed-By: Refael Ackermann <[email protected]>
1 parent 22ea3a8 commit 1e79a06

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/async-hooks/test-tlswrap.js

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ function onsecureConnect() {
9191
// TODO: why is client not destroyed here even after 5 ticks?
9292
// or could it be that it isn't actually destroyed until
9393
// the server is closed?
94+
if (client.before.length < 3) {
95+
tick(5, tick1);
96+
return;
97+
}
9498
checkInvocations(client, { init: 1, before: 3, after: 3 },
9599
'client: when client destroyed');
96100
//

0 commit comments

Comments
 (0)