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

jest reports that cacheable-lookup is leaking #19

Closed
kirillgroshkov opened this issue Apr 28, 2020 · 1 comment
Closed

jest reports that cacheable-lookup is leaking #19

kirillgroshkov opened this issue Apr 28, 2020 · 1 comment

Comments

@kirillgroshkov
Copy link

kirillgroshkov commented Apr 28, 2020

This is not my best issue report, since ATM I don't have time to put up the proper minimal repro.

But, when running jest --detectLeaks --detectOpenHandles (I guess only --detectOpenHandles is relevant here) it often prints this:

Test Suites: 1 failed, 11 passed, 12 total
Tests:       1 todo, 17 passed, 18 total
Snapshots:   0 total
Time:        10.615s

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

  ●  DNSCHANNEL

    > 1 | import got from 'got'
        | ^
      2 | 
      3 | const detectLeaks = process.argv.some(a => a.includes('detectLeaks'))
      4 | 

      at new CacheableLookup (node_modules/cacheable-lookup/source/index.js:62:14)
      at Object.<anonymous> (node_modules/got/dist/source/index.js:60:19)
      at Object.<anonymous> (src/jestOffline.util.test.ts:1:1)

I'll just leave this issue there until I have more information, or someone else comes with a better reproduction..

got@11 is used here

@szmarczak
Copy link
Owner

Duplicate of sindresorhus/got#1196

const got = require('got');

/*test('test',*/ (async () => {
  const data = await got('https://www.google.com');

//  expect(typeof data).toBe('object');
//  data.destroy(); // The same problem occurs without this code.
})();

If you run this code you can clearly see that the process exits. So it's not Got's neither CacheableLookup's fault. @CatsMiaow already made a comment on Jest repo with simplest reproducible code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants