Skip to content
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

Closed
BethGriggs opened this issue Oct 24, 2016 · 5 comments
Closed

parallel/test-http-set-timeout failing occasionally #9256

BethGriggs opened this issue Oct 24, 2016 · 5 comments
Labels
http Issues or PRs related to the http subsystem. test Issues and PRs related to the tests.

Comments

@BethGriggs
Copy link
Member

  • Version: 6.8.0 & 6.9.1
  • Platform: ppc64le

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.

@mscdex mscdex added http Issues or PRs related to the http subsystem. test Issues and PRs related to the tests. labels Oct 24, 2016
@gibfahn
Copy link
Member

gibfahn commented Oct 24, 2016

@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?

@Trott
Copy link
Member

Trott commented Oct 24, 2016

@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 ./node test/parallel/test-http-settimeout.js, it will hang forever and not give any indication as to what the problem is. I've thought about creating something in common.js that can be called in tests like this that detects if we are in CI or not and will set a timer if and only if we are not in CI. But that introduces its own complexity and I"m not sure it's worth it.

But yeah, +1 from me on removing that timer if it helps this situation and doesn't reduce the validity of the test.

BethGriggs added a commit to BethGriggs/node that referenced this issue Oct 25, 2016
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
@BethGriggs BethGriggs changed the title parallel/test-http-set-timeout failing occasionally on linux-ppc64le parallel/test-http-set-timeout failing occasionally Oct 25, 2016
@BethGriggs
Copy link
Member Author

I have managed to reproduce this error on darwin-x64 v6.9.1 (in 3000 runs I saw 3 failures).

@BethGriggs
Copy link
Member Author

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?

@Trott
Copy link
Member

Trott commented Oct 26, 2016

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...

evanlucas pushed a commit that referenced this issue Nov 3, 2016
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]>
MylesBorins pushed a commit that referenced this issue Nov 22, 2016
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]>
MylesBorins pushed a commit that referenced this issue Nov 22, 2016
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

No branches or pull requests

4 participants