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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Flush stdout before exiting process after running tests #14653

Merged
merged 1 commit into from
Apr 16, 2018
Merged

馃悰 Flush stdout before exiting process after running tests #14653

merged 1 commit into from
Apr 16, 2018

Conversation

rsimha
Copy link
Contributor

@rsimha rsimha commented Apr 16, 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.

This PR inserts process.stdout.write('\n') before each call to process.exit, since that will cause the output to get flushed.

@rsimha
Copy link
Contributor Author

rsimha commented Apr 16, 2018

@rsimha rsimha merged commit 98b8f86 into ampproject:master Apr 16, 2018
@rsimha rsimha deleted the 2018-04-16-FlushStdout branch April 16, 2018 22:52
@rsimha
Copy link
Contributor Author

rsimha commented Apr 17, 2018

Flushing the stdout before exiting didn't work. #14669 contains a new approach that doesn't rely on process.exit to quit the Karma server.

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