-
Notifications
You must be signed in to change notification settings - Fork 100
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
NodeJS Jest Open Handles Detected #254
Comments
From what I can gather this is an issue with napi, I am able to replicate this on sample repository provided by /** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
detectOpenHandles: true,
detectLeaks: true,
}; It leads to the same error:
And the error is triggered by simply importing 'index.js'. You don't have to use any function within it. The similar issue was faced by Prisma client as well, see: prisma/prisma#18146. Happy to accept contribution on this if you are familiar with the issue or know how to resolve it. Cheers! |
As no more info has been provided, closing. |
Jest testing framework, which is used for the tests in this repository for the NodeJS bindings, provides an optional command line open detectOpenHandles which:
Open handles can indicate that cleanup is not effectively happening. This can often happen with other libraries/utilities such as database connections not being closed/disposed.
Noticing that if
--detectOpenHandles
is added to the test command inbindings/nodejs/package.json
Jest does in fact detect an open handle.Even if
dispose()
is called in hooks such asafterEach
orafterAll
this issue still happens.Would you have any insight into why a handle remains open? Is this an issue with
napi
or is there possibly cleanup not actually happening? Outside of tests it could concerning if one can't completely close/dispose/destroy an engine instance. The use of--forceExit
is described by Jest as:Thank you for any insight you can provide.
The text was updated successfully, but these errors were encountered: