diff options
author | Rich Trott <rtrott@gmail.com> | 2017-10-02 15:16:10 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-10-04 23:53:11 -0700 |
commit | ad652afbe3800ce2064ac05b7c74f2f56e5a89f6 (patch) | |
tree | c4c7af59519702ee8706887c676d9ef014a0e1ee /test/async-hooks | |
parent | ddbf07ab89b501e0ee41c69655920757fb561ca0 (diff) | |
download | android-node-v8-ad652afbe3800ce2064ac05b7c74f2f56e5a89f6.tar.gz android-node-v8-ad652afbe3800ce2064ac05b7c74f2f56e5a89f6.tar.bz2 android-node-v8-ad652afbe3800ce2064ac05b7c74f2f56e5a89f6.zip |
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>
Diffstat (limited to 'test/async-hooks')
-rw-r--r-- | test/async-hooks/test-tlswrap.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/async-hooks/test-tlswrap.js b/test/async-hooks/test-tlswrap.js index 7d92b603f3..79cf1ab689 100644 --- a/test/async-hooks/test-tlswrap.js +++ b/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'); // |