-
Notifications
You must be signed in to change notification settings - Fork 822
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
[BUG] Jest unit tests have a memory leak or open handle that stops jest from exiting gracefully #307
Comments
The above is a list of all the test files that fail because of the leaky handle with the following error message: |
Attempted to resolve the issues on The second attempt was to increase the global jest timeout to a higher value in case the promises just take a longer period of time to resolve. I tried raising the value from the default 5000ms up to 10,000ms, and 30,000ms. Neither attempt managed to solve the timeout issue.* The third attempt was to clear and reset the mocks in the unit tests in case they had an effect on the promises resolving properly. In the
|
|
Unit tests when run with
|
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Describe the bug
When running the jest unit tests with command
yarn test:jest
tests pass but we get a warning that 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 --runInBand --detectOpenHandles to find leaks.
This warning seems to be triggering job failures in our GitHub actions.
To Reproduce
Steps to reproduce the behavior:
yarn test:jest
in the OpenSearch Dashboards directoryExpected behavior
The Jest unit tests should all pass and Jest should exit gracefully without having to pass a
--forceExit
flag to the commandOpenSearch Version
1.0
Dashboards Version
1.0
Additional context
I checked out Kibana 7.10.2 and they seem to have the same issue when running their jest unit tests.
The text was updated successfully, but these errors were encountered: