-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: use consistent timeouts #42893
test: use consistent timeouts #42893
Conversation
CC: @nodejs/http |
@@ -0,0 +1,133 @@ | |||
'use strict'; |
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.
Relying on timers is the most frequent source of flakiness in tests. Apart from doing it concurrently with multiple requests, does this test tests something not already tested in existing tests?
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.
I know, timers are messy. But unfortunately this test is about testing timers. :(
Yes, it checks that the concurrent checking of requestTimeout
and headersTimeout
works properly.
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.
My point is, are requestTimeout
and headersTimeout
already tested with a single request? If so what makes this test special? Why wouldn't the options work with multiple concurrent request if they work with a single one?
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.
Well, they should, but I thought adding a more complex "real world like" scenario would have helped for future regression testing.
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.
lgtm
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
@lpinca Are we good on this PR? Can we land it? |
I have no objections. |
@lpinca Do you mind leaving the second approval so I can proceed? |
PR-URL: #42893 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
Landed in c3aa86d |
PR-URL: #42893 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
Sadly, a test seems to be break ( test/parallel/test-http-server-request-timeouts-mixed.js) in V16.x: $ ./node test/parallel/test-http-server-request-timeouts-mixed.js
node:assert:123
throw new AssertionError(obj);
^
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
60000 !== 2000
at Object.<anonymous> (/home/juanarbol/GitHub/node/test/parallel/test-http-server-request-timeouts-mixed.js:34:8)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: 60000,
expected: 2000,
operator: 'strictEqual'
**}** |
This PR enforces consistent timeouts for HTTP tests.