You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently - tests can easily be stuck or never end, which makes it very hard to understand and locate where your problem might originate
for example, this program will be very hard to debug:
test('top level',{concurrency: 2},async(t)=>{awaitt.test('endless',()=>newPromise(()=>{setTimeout(()=>{},/* Large number */);}));// ... many other tests});
What is the feature you are proposing to solve the problem?
add a timeout to tests running via node:test, I propose adding a default timeout that will be configurable
one of the most important parts of testing is failing fast and knowing what the failure is, and timing out will help determine which test is misfunctioning
Activity
MoLow commentedon Jun 19, 2022
CC @benjamingr Please ping relevant people and add a label?
VoltrexKeyva commentedon Jun 19, 2022
@nodejs/test_runner
benjamingr commentedon Jun 19, 2022
Yes, this is a good idea and I am in favor. Is this something you'd like to work on?
MoLow commentedon Jun 19, 2022
Yes, assuming no objections
cjihrig commentedon Jun 19, 2022
No objections - this is something we should definitely support.
test_runner: support timeout for tests
feat: support timeout for tests
feat: support timeout for tests
feat: support timeout for tests
test_runner: support timeout for tests
test_runner: support timeout for tests
test_runner: support timeout for tests
bitflower commentedon Jul 10, 2023
Has this been implemented?
benjamingr commentedon Jul 19, 2023
Yeah there is a timeout parameter now check the test runner docs. @bitflower
bitflower commentedon Jul 19, 2023
Thanks for the feedback @benjamingr ! Sorry to not report back. I had found it in the meantime (it's different to e.g.
mocha).