-
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
parallel/test-http-set-timeout failing occasionally #9256
Comments
@Trott the timer on test-http-set-timeout.js#L21 seems unnecessary (I'm pretty sure the timer being tested is the one on Line 9). Is there any reason not to just wait for the test-runner timeout? |
@gibfahn It looks like that to me. There's definitely a faction (or maybe the entirety? certainly includes me) of @nodejs/testing that is all for removing timers like this. FWIW: The argument against removing it is that when the test fails via command line like But yeah, +1 from me on removing that timer if it helps this situation and doesn't reduce the validity of the test. |
Removed the errorTimer from test-http-set-timeout.js, as this timer is not necessary to test the setTimeout functionality. Also edited the console.log message on line 8 to log the correct timeout duration. Changed var to const, and added common.mustCall() to on timeout and on error callbacks. Fixes: nodejs#9256
I have managed to reproduce this error on darwin-x64 v6.9.1 (in 3000 runs I saw 3 failures). |
Is it possible that the req.connection.on('timeout') event listener (test-http-set-timeout.js#L11) is occasionally registered after the 500ms req.connection.setTimeout has already passed? |
Just to be sure, if you can reproduce the error reasonably reliably in the existing test (like, there's always at least one failure in 5K runs or something), you could try moving lines 9 and 10 to the end of the function and see if that fixes it. Even if there's no way that should be happening, it's not a bad idea to confirm... |
Removed the errorTimer from test-http-set-timeout.js, as this timer is not necessary to test the setTimeout functionality. Also edited the console.log message on line 8 to log the correct timeout duration. Changed var to const, and added common.mustCall() to on timeout and on error callbacks. Fixes: #9256 PR-URL: #9264 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
Removed the errorTimer from test-http-set-timeout.js, as this timer is not necessary to test the setTimeout functionality. Also edited the console.log message on line 8 to log the correct timeout duration. Changed var to const, and added common.mustCall() to on timeout and on error callbacks. Fixes: #9256 PR-URL: #9264 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
Removed the errorTimer from test-http-set-timeout.js, as this timer is not necessary to test the setTimeout functionality. Also edited the console.log message on line 8 to log the correct timeout duration. Changed var to const, and added common.mustCall() to on timeout and on error callbacks. Fixes: #9256 PR-URL: #9264 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
parallel/test-http-set-timeout
I have seen this test fail up to 10 times in 5000 runs on ppc64le (Ubuntu 14.04) with the error
'throw new Error('Timeout was not successful');'.
Also, the console.log on line 8 states 'setting 1 second timeout', despite the timeout on line 9 being set to 500ms.
The text was updated successfully, but these errors were encountered: