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

Firestore's GRPC client does not terminate its open connection with Jest 27.0.1 #4947

Closed
inf3rnus opened this issue May 27, 2021 · 1 comment
Labels
api: firestore testing-sdk testing with emulator

Comments

@inf3rnus
Copy link

inf3rnus commented May 27, 2021

[REQUIRED] Describe your environment

  • Operating System version: Ubuntu 18.04 LTS
  • Browser version: NA (Related to Jest tests, so jsdom)
  • Firebase SDK version: 8.6.2
  • Firebase Product: firestore

[REQUIRED] Describe the problem

This may not be a firebase problem (although it very well could be), but it is tied to firebase, so I thought I'd leave this for your team's awareness/investigation.

Jest 27.0.1 does not exit tests cleanly in that it complains of pending asynchronous operations. The pending asynchronous operation when running --detectOpenHandles comes from the grpc client used by Firestore, it does not seem to close its socket, either in time, or it hangs. This may be due to its interaction with jsdom.

One thing to note is that Jest 25.5.4 does exit tests cleanly.

I've alerted the Jest team to this issue here: jestjs/jest#11464

Steps to reproduce:

  1. Clone this repro repo I've made: https://github.com/inf3rnus/firebase-jest-pending-grpc-connection
  2. Run the following: npm i
  3. Run: npx jest (You'll see the tests do not exit cleanly.)
  4. Run: npx jest --detectOpenHandles (This will show the specific source of the hanging resource.)

Relevant Code:

https://github.com/inf3rnus/firebase-jest-pending-grpc-connection

Here's are some pictures showing what's happening:

Normal jest run:

image

Jest with --detectOpenHandles:

image

@looptheloop88
Copy link

Hi @inf3rnus, thanks for the report. This is a duplicate of #4884. The logs when running jest with --detectOpenHandles option will help in the investigation. Thanks for the report, we appreciate it.

@firebase firebase locked and limited conversation to collaborators Jun 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: firestore testing-sdk testing with emulator
Projects
None yet
Development

No branches or pull requests

3 participants