-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
The process exits normally, but I get an open handle error. #9982
Comments
Can you provide a minimal repro which can be downloaded? |
Still seeing this issue in the latest version Jest to date, v26.4.0. |
Still seeing this issue. Node 14.15.0 |
Is there any workaround? it causes jest to hang forever and never complete. |
@mifi you can use |
This was an annoying for us as well. I noticed if you just raise the timeout and give the DNS time to close, it won't emit this error, so another potential workaround?
|
I'm seeing this as well, seems to have started when I upgraded from Jest 25 to 26 and switched to the jest-circus runner. |
I am also having the same issue please fix this now its been there from long time. |
Same symptoms here w/Jest v.26.0.23 and node v14.15.0. The minimal repro provided by @CatsMiaow (https://github.com/CatsMiaow/jest-issues-9982) seems to validate the issue on my end. |
Same happens here repo https://github.com/seahindeniz/jest-dnschannel-issue |
After looking into this, I think the DNSCHANNEL is harmless. If I'm understanding the code correctly, the Resolver class from Node.js's However:
Based on that, I'm thinking that DNSCHANNEL is a false positive: it's harmless, it's not actually keeping Jest from exiting, and if Jest is kept from exiting, it's because of some other resource (which may not be showing up correctly for various reasons - see, e.g., #11464). |
Yes, it's probably a false positive one, but I believe it's interrupting the development process. The logs are too annoying, and it eats too much line from the terminal and leads us to scroll up every time. I think I've faced this issue after upgrading the Jest from v26.6.3 to v27.0.1 |
@joshkel yeah, I think you’re correct about (I made some improvements to this area of the codebase just before the Jest 27 release, so I’m at least a little familiar with what’s going on there. 🙂) |
It turns out that Node.js only holds a weak reference on `DNSCHANNEL` async resources, so they won't prevent a process from exiting. This changes `--detectOpenHandles` to ignore `DNSCHANNEL` handles. Because Jest dedupes open handles by their stack trace, and async handles indirectly opened from *other* async handles get the same stack trace as the first handle, tracking the `DNSCHANNEL` resource can obscure other, more meaningful handles that were indirectly created and actually *are* causing the process to hang. Fixing this makes it a little easier for users to identify the actual issue that might be causing their tests to hang. Fixes jestjs#9982.
* Migrate to jest * Use --force-exit until dns close handle issue jestjs/jest#9982 Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Related issues #6423 (comment)
This code terminates the process normally but
Jest
gives an open handle error.The text was updated successfully, but these errors were encountered: