Repository navigation
Test runner swallows uncaughtException #44612
Description
Activity
- addedtest_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
on Sep 12, 2022 - Reacted by Moshe Atlow
I think the rationale for this behavior is that the test finishes without an error, which makes the test runner conclude that it passes. After which any lingering async running code is just dismissed (and errors swallowed). This is to some extent alluded to in the docs.
I am not sure whether this is the ideal behavior, but I can at least see how it could be considered by design.
Without --test, at least there is a warning, but the process exit code still indicates success.
When I originally wrote that code, I went back and forth on whether or not to change the exit code when this happens. I figured I'd wait and see if anyone complained. Someone complained now, so let's just change the exit code when a warning occurs.
Reacted by Moshe Atlow@timmolendijk are you interested in creating a PR fixing this?
if not I will@MoLow Interested yes. Available not yet sure.
Reacted by Moshe Atlowaccording to @cjihrig 's comment, the fix will require setting
process.exitCodewithing theuncaughtExceptionhandler.
feel free to ping me if you need help- addedgood first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
on Oct 27, 2022 @MoLow I interest in creating a PR fixing this. If @timmolendijk not work on it yet, Can I take this up?
please do :)
Reacted by MURAKAMI Masahiko@fossamagna Yeah please do, I hadn’t got around to it yet. Thanks!
Reacted by MURAKAMI Masahiko3 remaining items
- added a commit that references this issue
on Dec 9, 2022 - added a commit that references this issue
on Jan 23, 2023 - added a commit that references this issue
on Feb 25, 2023 - added 2 commits that reference this issue
on Mar 3, 2023
Version
v18.9.0
Platform
Linux ubuntuserver 5.15.0-1019-azure #24-Ubuntu SMP Tue Aug 23 15:05:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
test_runner
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
The exit code of the process should indicate failure, not success. This is what happens without the experimental
node:testand it is what other test runners do, too.What do you see instead?
node --testswallows the error altogether. Not even a warning.Without
--test, at least there is a warning, but the process exit code still indicates success.Additional information
No response