-
-
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 when current test is pending #4083
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
force-pushed
the
juergba/uncaught-swallow
branch
from
October 26, 2019 15:07
b72c5af
to
c012341
Compare
juergba
force-pushed
the
juergba/uncaught-swallow
branch
2 times, most recently
from
November 4, 2019 10:04
5e40b1c
to
75b95bd
Compare
juergba
changed the title
uncaughtException: fix ignoring them when test has already failed or is pending
uncaughtException: fix when current test is pending
Nov 4, 2019
juergba
force-pushed
the
juergba/uncaught-swallow
branch
from
November 4, 2019 17:26
75b95bd
to
8b1138a
Compare
juergba
added
area: async
related to asynchronous use of Mocha
type: bug
a defect, confirmed by a maintainer
status: needs review
a maintainer should (re-)review this pull request
semver-major
implementation requires increase of "major" version number; "breaking changes"
labels
Nov 4, 2019
craigtaub
approved these changes
Nov 7, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
juergba
force-pushed
the
juergba/uncaught-swallow
branch
from
November 21, 2019 09:39
8b1138a
to
531fb5b
Compare
juergba
force-pushed
the
juergba/uncaught-swallow
branch
from
November 22, 2019 15:00
531fb5b
to
a0b203d
Compare
juergba
removed
the
status: needs review
a maintainer should (re-)review this pull request
label
Nov 22, 2019
76 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: async
related to asynchronous use of Mocha
semver-major
implementation requires increase of "major" version number; "breaking changes"
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
output with exitCode: 0
Description of the Change
Runner#uncaught
:per default Mocha tries to map
uncaughtException
's to the correct test case, to recover and keep therunner
working. This is quite simple with synchronous tests, in an async scenario (by design or by coder's mistake) it's done on a "best effort" basis.Currently the user has no possibility to escape this recovery effort, not even with the
--allow-uncaught
option. Now--allow-uncaught
throws an error and exit Mocha's process.current test is pending: when an
uncaughtException
bubbles up, we retrospectively label the pending test as failed, then keep the runner going. That way theexitCode
will be >0.When an
uncaughtException
bubbles up we can't clearly determine its origin. I suppose our recovery process is responsible for a few weird bugs, eg. number of executed tests is varying when rerun, errors are swallowed (reporters?) or non-existing hooks throw errors. So its important to have an effective mean to throw and exit when tracing fuzzy errors.Recovery process, when current test is:
uncaughtException
, runner keeps goingApplicable issues
closes #3938