-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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 runner swallows uncaughtException #44612
Comments
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. |
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. |
@timmolendijk are you interested in creating a PR fixing this? |
@MoLow Interested yes. Available not yet sure. |
according to @cjihrig 's comment, the fix will require setting |
@MoLow I interest in creating a PR fixing this. If @timmolendijk not work on it yet, Can I take this up? |
please do :) |
@fossamagna Yeah please do, I hadn’t got around to it yet. Thanks! |
Fixes: nodejs#44612 PR-URL: nodejs#45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: nodejs#44612 PR-URL: nodejs#45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: nodejs#44612 PR-URL: nodejs#45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: nodejs#44612 PR-URL: nodejs#45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: nodejs#44612 PR-URL: nodejs#45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: nodejs#44612 PR-URL: nodejs#45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: nodejs#44612 PR-URL: nodejs#45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: nodejs#44612 PR-URL: nodejs#45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: nodejs#44612 PR-URL: nodejs#45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: nodejs/node#44612 PR-URL: nodejs/node#45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> (cherry picked from commit 06603c44a5b0e92b1a3591ace467ce9770bf9658)
Fixes: nodejs/node#44612 PR-URL: nodejs/node#45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> (cherry picked from commit 06603c44a5b0e92b1a3591ace467ce9770bf9658)
Fixes: nodejs/node#44612 PR-URL: nodejs/node#45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> (cherry picked from commit 06603c44a5b0e92b1a3591ace467ce9770bf9658)
Fixes: nodejs/node#44612 PR-URL: nodejs/node#45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> (cherry picked from commit 06603c44a5b0e92b1a3591ace467ce9770bf9658)
Fixes: nodejs#44612 PR-URL: nodejs#45264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
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:test
and it is what other test runners do, too.What do you see instead?
node --test
swallows 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
The text was updated successfully, but these errors were encountered: