-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: investigate async-hooks/test-tlswrap #14404
Comments
Probably race condition. The comment around before line 93 (where the test fails) kind of suggests that too: // 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? |
I've tested it on 8.2.0 as well, same error. |
FreeBSD is also affected https://ci.nodejs.org/job/node-test-commit-freebsd/11775/nodes=freebsd10-64/console I guess it is system independent. |
@nodejs/async_hooks it would be great if this could be looked at. Having a green CI for the next Code & Learn would be really neat. |
I managed to replicate this locally on macOS. Did it by running 96 simultaneous copies of the test. Definitely strengthens the case that this is a race condition... $ tools/test.py -j 96 --repeat 192 async-hooks/test-tlswrap
=== release test-tlswrap ===
Path: async-hooks/test-tlswrap
assert.js:45
throw new errors.AssertionError({
^
AssertionError [ERR_ASSERTION]: Checking invocations at stage "client: when client destroyed":
Called "before" 2 time(s), but expected 3 invocation(s).
at checkHook (/Users/trott/io.js/test/async-hooks/hook-checks.js:51:14)
at Array.forEach (<anonymous>)
at checkInvocations (/Users/trott/io.js/test/async-hooks/hook-checks.js:28:44)
at tick1 (/Users/trott/io.js/test/async-hooks/test-tlswrap.js:94:5)
at Immediate.ontick [as _onImmediate] (/Users/trott/io.js/test/async-hooks/tick.js:7:37)
at runCallback (timers.js:798:20)
at tryOnImmediate (timers.js:760:5)
at processImmediate [as _immediateCallback] (timers.js:731:5)
Command: out/Release/node /Users/trott/io.js/test/async-hooks/test-tlswrap.js
[00:19|% 100|+ 191|- 1]: Done
$ |
Hmmm....I see this test uses |
PR to fix the |
`test/async-hooks/test/test-tlswrap.js` uses `common.PORT` but async-hooks tests are run in parallel. Another test using port 0 could result in a port collision. Remove `common.PORT` from the test. Refs: nodejs#14404 (comment)
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. Fixes: nodejs#14404
Proposed fix for this issue: #15744 |
@Trott did you manage to repro on CI? |
@refack Yes. https://ci.nodejs.org/job/node-stress-single-test/1436/nodes=osx1010/console |
`test/async-hooks/test/test-tlswrap.js` uses `common.PORT` but async-hooks tests are run in parallel. Another test using port 0 could result in a port collision. Remove `common.PORT` from the test. PR-URL: nodejs#15742 Ref: nodejs#14404 (comment) Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
`test/async-hooks/test/test-tlswrap.js` uses `common.PORT` but async-hooks tests are run in parallel. Another test using port 0 could result in a port collision. Remove `common.PORT` from the test. PR-URL: #15742 Ref: #14404 (comment) Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
`test/async-hooks/test/test-tlswrap.js` uses `common.PORT` but async-hooks tests are run in parallel. Another test using port 0 could result in a port collision. Remove `common.PORT` from the test. PR-URL: #15742 Ref: #14404 (comment) Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
`test/async-hooks/test/test-tlswrap.js` uses `common.PORT` but async-hooks tests are run in parallel. Another test using port 0 could result in a port collision. Remove `common.PORT` from the test. PR-URL: nodejs/node#15742 Ref: nodejs/node#14404 (comment) Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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: nodejs/node#15744 Fixes: nodejs/node#14404 Reviewed-By: Refael Ackermann <refack@gmail.com>
master
Has been spotted on macOS:
The text was updated successfully, but these errors were encountered: