digikare / nestjs-prom

A prometheus module for nestjs
160 stars 54 forks source link

RANDOMBYTESREQUEST when running a jest e2e test #54

Closed cre8 closed 3 years ago

cre8 commented 3 years ago

All tests are passing, but I get the following output:

Test Suites: 1 passed, 1 total
Tests:       5 passed, 5 total
Snapshots:   0 total
Time:        19.384 s, estimated 20 s
Ran all test suites.

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

  ●  RANDOMBYTESREQUEST

      at rng (node_modules/@nestjs/common/node_modules/uuid/dist/rng.js:18:21)
      at Object.v4 (node_modules/@nestjs/common/node_modules/uuid/dist/v4.js:17:63)
      at Object.createParamDecorator (node_modules/@nestjs/common/decorators/http/create-route-param-metadata.decorator.js:14:30)
      at Object.<anonymous> (node_modules/@digikare/nestjs-prom/dist/common/prom-counter.decorator.js:6:32)

I added a timeout of 1000ms to afterEach and afterAll to give the system more time but I still get the error. I am even more confused since I am not using the decorators but only the promService to interact with prometheus.

cre8 commented 3 years ago

This message only occurs when jest runs with the --detectOpenHandles. So I think it's not a bug from the library, but just an information form jest for a potential issue when the test is stuck.