-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
uncaughtException: fix double EVENT_RUN_END events #4025
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
juergba
added
type: bug
a defect, confirmed by a maintainer
status: needs review
a maintainer should (re-)review this pull request
semver-patch
implementation requires increase of "patch" version number; "bug fixes"
labels
Sep 20, 2019
juergba
force-pushed
the
juergba/uncaught-bail
branch
from
September 22, 2019 07:21
e4f5383
to
f3ca9f2
Compare
outsideris
approved these changes
Sep 22, 2019
juergba
force-pushed
the
juergba/uncaught-bail
branch
from
September 24, 2019 08:23
f3ca9f2
to
9bee904
Compare
@outsideris I had to adapt my former solution. Bailing the current suite bailed only the current suite, nevertheless subsequent suites were still executed. |
juergba
force-pushed
the
juergba/uncaught-bail
branch
from
September 24, 2019 09:10
9bee904
to
1fbb9f0
Compare
juergba
removed
the
status: needs review
a maintainer should (re-)review this pull request
label
Sep 26, 2019
boneskull
pushed a commit
that referenced
this pull request
Oct 18, 2019
abort runner instead of end event
This was referenced Oct 27, 2019
This was referenced May 21, 2024
This was referenced Sep 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
landed-on-v6.2.x
cherry-picked on v6.2.x branch from master
semver-patch
implementation requires increase of "patch" version number; "bug fixes"
type: bug
a defect, confirmed by a maintainer
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Per default Mocha tries to recover from
uncaughtException
and to map the exception to the correct test case. It's not possible to recover gracefully if a Runnable has already passed successfully and then fails asynchronously.Firing an
EVENT_RUN_END
out of a suite other than the root suite is wrong and will result in the emission of doubleEVENT_RUN_END
events. The first event will not abort the runner and a second event will be fired by the root suite. We already had a similar issue, see #3617.To prevent double test epilogues the reporters have been "fixed" in the past by using
runner.once(EVENT_RUN_END, ...)
.Following tests were ineffective:
Description of the Change
Instead of emitting an
EVENT_RUN_END
event we useSuite#bail()
Runner#abort()
to bail the runner cleanly.Applicable issues