-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Jest fails with Node Workers producing stderr/stdout output #21685
Comments
You can remove jest from this entirely and repro the same issue by just reworking jacogr/jest-node-worker/index.js to message itself from Update: The issue is related to
|
The terminate actually got added to work around another issues when testing - i.e. if the worker is not terminated, it hangs around and the test process also fails since "something is still active". Going back to how I arrived at this, i.e. from the code where I used it, I do recall the worker doing output - that must have been before I had to add the terminate to tests then. PS: In this case the terminate is called inside the function, which actually, as a test-case, does not quite match up with what I have in reality. In reality I have something like -
In the simplification I didn't expose an actual |
Calling |
With Jest & Node 10.5+ (experimental) workers, any output in the worker to stdout/stderr makes the test fail. To clarify, the test itself passes, but the overall execution fails. Node cannot find the stream to write to at the end of execution, possibly due to Jest bufferring?
When the Worker has no writes to stderr/stdout output, everything works as expected.
A repo with a reproduction is found here - https://github.com/jacogr/jest-node-worker
yarn run test
It has also been logged with Jest at jestjs/jest#6646 (My first assumption was that it has to do with io buffers, but at the same time it fails internally to the Node workers implementation - so logging it here as well)
The text was updated successfully, but these errors were encountered: