-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: skip test if host is too slow #15688
Conversation
test-http-server-consumed-timeout will fail if the host is sufficiently loaded that a 25ms interval takes more than 200ms to be invoked. Skip the test in that situation. Fixes: nodejs#14312
The robustness here can be checked by copying the test to tools/test.py -j 96 --repeat 192 test/parallel/test-http-server-consumed-timeout.js On master, I get many many failures that way. With this change, no failures. |
CI stress test against master showing infrequent but still non-zero failures even though the test is in sequential: https://ci.nodejs.org/job/node-stress-single-test/1427/nodes=rhel72-s390x/console CI stress test against this pull request, hopefully will come back green: https://ci.nodejs.org/job/node-stress-single-test/1428/nodes=rhel72-s390x/console |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just nits
common.mustNotCall('Request timeout should not fire')); | ||
req.setTimeout(TIMEOUT, () => { | ||
if (!intervalWasInvoked) | ||
common.skip('interval was not invoked quickly enough for test'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: return common.skip()
as to not confuse static analysers
const now = Date.now(); | ||
console.log('diff is ' + (now - time)); | ||
if (time < now - TIMEOUT) | ||
common.skip('interval is not invoked quickly enough for test'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: return common.skip()
as to not confuse static analysers
// to be invoked, skip the test. | ||
const now = Date.now(); | ||
console.log('diff is ' + (now - time)); | ||
if (time < now - TIMEOUT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I find now - time > TIMEOUT
more intuitive
I'm curious - is this a first? A test that skips if it times out? |
@Fishrock123 There is at least one similar case node/test/async-hooks/test-callback-error.js Lines 94 to 120 in 95c8503
If macOS is not configured properly creating a core dump could timeout so we preemptively timeout |
test-http-server-consumed-timeout will fail if the host is sufficiently loaded that a 25ms interval takes more than 200ms to be invoked. Skip the test in that situation. PR-URL: nodejs#15688 Fixes: nodejs#14312 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Landed in a3cd8ed |
test-http-server-consumed-timeout will fail if the host is sufficiently loaded that a 25ms interval takes more than 200ms to be invoked. Skip the test in that situation. PR-URL: nodejs/node#15688 Fixes: nodejs/node#14312 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
test-http-server-consumed-timeout will fail if the host is sufficiently loaded that a 25ms interval takes more than 200ms to be invoked. Skip the test in that situation. PR-URL: #15688 Fixes: #14312 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
test-http-server-consumed-timeout will fail if the host is sufficiently loaded that a 25ms interval takes more than 200ms to be invoked. Skip the test in that situation. PR-URL: #15688 Fixes: #14312 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
test-http-server-consumed-timeout will fail if the host is sufficiently loaded that a 25ms interval takes more than 200ms to be invoked. Skip the test in that situation. PR-URL: #15688 Fixes: #14312 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
test-http-server-consumed-timeout will fail if the host is sufficiently loaded that a 25ms interval takes more than 200ms to be invoked. Skip the test in that situation. PR-URL: #15688 Fixes: #14312 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
test-http-server-consumed-timeout will fail if the host is sufficiently
loaded that a 25ms interval takes more than 200ms to be invoked. Skip
the test in that situation.
Fixes: #14312
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test