node-rs icon indicating copy to clipboard operation
node-rs copied to clipboard

xxh32 leaves open handle

Open urugator opened this issue 2 years ago • 1 comments

Hi, xxh32 (not sure if specifically this function or the lib in general) seems to be leaking some resources. When used as part of jest tests, it randomly causes: "Jest did not exit one second after the test run has completed." When executed with --detectOpenHandles:

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


    > 1 | import { xxh32 } from '@node-rs/xxhash';
        | ^
      2 | xxh32('foobarbaz');
      3 |

      at Runtime._loadModule (../../node_modules/jest-runtime/build/index.js:1218:29)
      at Object.<anonymous> (../../node_modules/@node-rs/xxhash/index.js:64:29)
      at Object.<anonymous> (test/foo.spec.ts:1:1)

This issue was originally reported as part of @nestjs repo: https://github.com/nestjs/nest/issues/11072

While at it, hope it's ok if I mention another issue that prevents adoption by the same lib, which deals with cross-platform development: https://github.com/nestjs/nest/issues/11071 Could you perhaps clarify if this is expected behavior? Is the generated lockfile platform specific? Is this workflow possible/supported? What would be the correct/intended way to handle such situation? Thank you.

urugator avatar Feb 07 '23 22:02 urugator

I'm having the same issue in my jest tests with the xxh3.xxh3.xxh64.

Jest has detected the following 1 open handle potentially keeping Jest from exiting:
    > | import * as xxh3 from '@node-rs/xxhash';

djluis avatar Nov 14 '24 13:11 djluis