The process exits normally, but I get an open handle error.
See original GitHub issue- Node.js v12.16.2
- Jest v26.0.1
Related issues https://github.com/facebook/jest/issues/6423#issuecomment-620407580
This code terminates the process normally but Jest
gives an open handle error.
import { promises } from 'dns';
//= const { promises } = require('dns');
const { Resolver } = promises;
const resolver = new Resolver();
const servers = resolver.getServers();
console.log(servers);
Issue Analytics
- State:
- Created 3 years ago
- Reactions:23
- Comments:15 (2 by maintainers)
Top Results From Across the Web
is it a good practice to close file descriptors on exit
When a process terminates, all of its open files are closed automatically by the kernel. Many programs take advantage of this fact and...
Read more >Open handle keeps Jest from exiting ( TCPSERVERWRAP)
Error: Jest has detected the following 1 open handle potentially keeping Jest from exiting: ○ TCPSERVERWRAP Env: Node 10 Supertest 3.3.0 ...
Read more >Let It Crash: Best Practices for Handling Node.js Errors on ...
The most common one is the process. exit. You can pass an exit code, the zero if it's a success exit or higher...
Read more >Chapter 5. Concurrent error-handling and fault tolerance with ...
In this chapter, you'll first learn about links, monitors, trapping exits, and processes, and how they come together as the fundamental building blocks...
Read more >C++ Tutorial: Handling Exceptions - 2020
A program may have division by zero, or page fault, or may request more memory than is available, or it may try to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mifi you can use
--forceExit
CLI option, but it’s just a workaround. I hope it will be fixed soon.@joshkel yeah, I think you’re correct about
DNSCHANNEL
— it’s also explicitly marked as a weak reference in the Node.js source (just a couple lines after one of the ones you linked), so Jest probably shouldn’t track it. There’s actually an explicit block of code for this kind of thing (async stuff that shouldn’t prevent the process from exiting or be tracked), butDNSCHANNEL
just isn’t included there and probably should be: https://github.com/facebook/jest/blob/2cb20e945a26b2c9867b30b787e81f6317e59aa1/packages/jest-core/src/collectHandles.ts#L65-L73(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. 🙂)