Skip to content
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

🐛 Don't call process.exit() in Karma during normal pass / fail flow #14669

Merged
merged 1 commit into from
Apr 17, 2018
Merged

🐛 Don't call process.exit() in Karma during normal pass / fail flow #14669

merged 1 commit into from
Apr 17, 2018

Conversation

rsimha
Copy link
Contributor

@rsimha rsimha commented Apr 17, 2018

When we exit Karma after running tests, it sometimes prematurely exits while its reporters are busy writing to the console. This also breaks Travis log folding, and makes the logs difficult to read. For example, see https://travis-ci.org/ampproject/amphtml/jobs/367291014#L1391-L1397

Unfortunately, this is due to the asynchronous nature of stdout in nodejs. See nodejs/node#6456, nodejs/node#6379, yarnpkg/yarn#5005, etc.

In #14653, we tried to flush stdout before exiting. It turns out that process.exit() is the wrong way to exit from a Karma process after tests have run. This PR removes calls to process.exit() from all normal exit flows, and instead, allows the resolver to do its thing.

Follow up to #14653

@rsimha
Copy link
Contributor Author

rsimha commented Apr 17, 2018

/to @jridgewell @erwinmombay

@rsimha rsimha merged commit 1f5fc08 into ampproject:master Apr 17, 2018
@rsimha rsimha deleted the 2018-04-17-DontExit branch April 17, 2018 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants