googleapis / nodejs-logging

Node.js client for Stackdriver Logging: Store, search, analyze, monitor, and alert on log data and events from Google Cloud Platform and Amazon Web Services (AWS).
https://cloud.google.com/logging/
Apache License 2.0
171 stars 62 forks source link

Import from @google-cloud/logging makes jest tests hang #1515

Open goodwin64 opened 3 months ago

goodwin64 commented 3 months ago

1) Is this a client library issue or a product issue? It's a library issue.

2) Did someone already solve this? It doesn't seem to be solved - Google doesn't give such results.

3) Do you have a support contract? Yes, I'll duplicate this request there as well.

Environment details

Steps to reproduce

  1. clone https://github.com/goodwin64/gcp-logging-jest-timeout
  2. yarn install
  3. yarn test
  4. Notice jest warns there are unresolved async operations:
gcp-logging-jest-timeout % yarn test
yarn run v1.22.19
$ jest
 PASS  src/trueBeTrue.test.ts
  true is true
    ✓ should be true (1 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        4.142 s, estimated 5 s
Ran all test suites.
Jest did not exit one second after the test run has completed.

'This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
✨  Done in 8.10s.
cindy-peng commented 2 months ago

Hi @goodwin64 , did you notice this issue in any other google cloud-logging releases other than 11.1.0 and 10.4.0?

goodwin64 commented 2 months ago

Hey @cindy-peng, just these 2 as I tested just them. Maybe it can be reproduced in older versions too.