test_runner: add timeout support to test plan#56765
test_runner: add timeout support to test plan#56765nodejs-github-bot merged 10 commits intonodejs:mainfrom
Conversation
|
Review requested:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #56765 +/- ##
==========================================
+ Coverage 89.10% 90.34% +1.24%
==========================================
Files 665 629 -36
Lines 193203 184445 -8758
Branches 37220 36038 -1182
==========================================
- Hits 172158 166646 -5512
+ Misses 13771 10918 -2853
+ Partials 7274 6881 -393
|
| const { test, suite } = require('node:test'); | ||
| const { Readable } = require('node:stream'); | ||
|
|
||
| suite('input validation', () => { |
There was a problem hiding this comment.
I would actually add all of these new tests to a separate "regular" test file. I don't think we necessarily need to check snapshot output for these. Snapshot tests are more tedious to maintain over time (they need regenerated and introduce merge conflicts). Plus, the linter doesn't run on fixture files.
There was a problem hiding this comment.
As soon as possible I'll update these tests
|
This is looking good to me. I'm disappointed that we can't default a timeout (I believe there will be confusion about why, likely broken, tests never end), but this is still a win. |
d9a7124 to
08951bd
Compare
| * If a number, it specifies the maximum wait time in milliseconds | ||
| before timing out while waiting for expected assertions and subtests to be matched. | ||
| If the timeout is reached, the test will fail. |
There was a problem hiding this comment.
Should the maximal value be pointed out here?
There was a problem hiding this comment.
Are you suggesting that there should be a maximum value possible for the wait?
There was a problem hiding this comment.
I don't see a need for it. If someone wants to set the timeout to Number.MAX_VALUE, then that's on them. I think most people will be reasonable and set it on the order of seconds.
There was a problem hiding this comment.
IMHO, validating the maximum value is a good way to inform the user of misuse.
I honestly would avoid reporting this maximum in the documentation, as has been done in this case https://github.com/nodejs/node/pull/56595/files .
There was a problem hiding this comment.
@atlowChemi @jsumners If you are okay with this, I would avoid documenting this implementation detail!
There was a problem hiding this comment.
I am good with the PR as it is.
There was a problem hiding this comment.
I'll just address the last comment related to tests and restart the CIs
There was a problem hiding this comment.
@pmarchini I left this comment while approving the PR - so this is non-blocking IMHO 🙂
I agree with this. Get this landed and then refactor. |
|
Landed in 8c2df73 |
PR-URL: #56765 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: #56765 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: #56765 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: #56765 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: #56765 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: nodejs#56765 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: #56765 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: #56765 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: #56765 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: #56765 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: #56765 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: #56765 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: #56765 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: #56765 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
This PR attempts to address #56758.
One major concern about this feature: to allow the timeout to interrupt the tests the
--test-force-exit flagis required.I'm opening this PR as a draft to validate the implementation and behaviour.
Documentation still needs to be updated!