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

Jest tests exit with "A worker process has failed to exit gracefully and has been force exited." #19

Closed
MatthewWid opened this issue Jul 11, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@MatthewWid
Copy link
Owner

The Jest test suite has an issue that Jest reports as a memory leak whereby some handles are not being properly destroyed after the tests finish.

The complete error message is:

A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks.

Running with --detectOpenHandles simply causes the test run to hang and gives no additional information, perhaps related to this issue in Jest itself.

Sometimes, nondeterministically, Jest will also report the following:

Jest did not exit one second after the test run has completed.

This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with --detectOpenHandles to troubleshoot this issue.

Perhaps related to this Jest issue.


To reproduce:

  1. Follow the 'Local Development' steps in the README.

My assumption here is that in one of the tests that imperatively destroys the connection between the server and the EventSource is not cleaning up the EventSource reconnect, and it is attempting to connect again instead of being closed causing a leak. But I am not totally sure.

@MatthewWid MatthewWid added bug Something isn't working help wanted Extra attention is needed labels Jul 11, 2021
@MatthewWid
Copy link
Owner Author

Closing as this appears to be fixed in v0.7.0 after updating all dependencies to their latest versions. Not sure exactly which dependency was causing the issue, but I suspect it was an update to a Jest-Typescript package.

@MatthewWid MatthewWid removed the help wanted Extra attention is needed label Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant