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

ELDHISTOGRAM open handle #10020

Closed
electriquo opened this issue May 11, 2020 · 6 comments Β· Fixed by #10417
Closed

ELDHISTOGRAM open handle #10020

electriquo opened this issue May 11, 2020 · 6 comments Β· Fixed by #10417

Comments

@electriquo
Copy link

electriquo commented May 11, 2020

πŸ› Bug Report

i use prom-client version 12.0.0.

when i run jest --detectOpenHandles i get

Jest has detected the following 1 open handle potentially keeping Jest from exiting:

  ●  ELDHISTOGRAM

      3 | const client = require("prom-client");
      4 | const prefix = "foo";
    > 5 | client.collectDefaultMetrics({ prefix });

To Reproduce

// prom.test.js

const client = require("prom-client");
const prefix = "foo";
client.collectDefaultMetrics({ prefix });
$ npm install prom-client --save
$ npm test prom.test.js

Expected behavior

when running jest --detectOpenHandles, it should not detect ELDHISTOGRAM as open handle

envinfo

$ npx envinfo --preset jest
npx: installed 1 in 2.624s

  System:
    OS: macOS 10.15.4
    CPU: (8) x64 Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz
  Binaries:
    Node: 14.2.0 - ~/.nvm/versions/node/v14.2.0/bin/node
    npm: 6.14.5 - ~/.nvm/versions/node/v14.2.0/bin/npm
  npmPackages:
    jest: ^26.0.1 => 26.0.1
@SimenB
Copy link
Member

SimenB commented May 11, 2020

Since these handles don't actually keep the process open, we should just skip them here: https://github.com/facebook/jest/blob/0e0eeed9d794fe0d6d7e84f555d9684f9e944221/packages/jest-core/src/collectHandles.ts#L55-L57

@electriquo
Copy link
Author

@SimenB: will the following due?

if (['PROMISE', 'TIMEWRAP', 'ELDHISTOGRAM'].includes(type)) { 
   return; 
 } 

@SimenB
Copy link
Member

SimenB commented May 11, 2020

You can make that change in your own node_modules locally - if it removes the false positives then yes πŸ™‚

For a PR we'll also need a test, but I can help out with that once a PR is open πŸ‘

@electriquo
Copy link
Author

electriquo commented May 11, 2020

@SimenB: made the modification at ./node_modules/@jest/core/build/collectHandles.js:132 it makes jest hang - jest does not terminate gacefully.

@SimenB
Copy link
Member

SimenB commented Aug 20, 2020

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants