-
Notifications
You must be signed in to change notification settings - Fork 902
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
initializeTestEnvironment sometimes failed due to Node.js fetch failed by SocketError: other side closed #8690
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Hi @jin-qin! Retrying should be a safe approach as far as I know. It is possible that the emulator isn't ready to accept connections, so upon second attempt it will work. If the problem persists, please let us know. |
Yes, agreed! Generally this error means that the runtime couldn't connect to the emulator. If the problem persists, it would be helpful to know if the emulator has logged any errors when it was initialized. |
Thank you folks for the quick responses! The only error I got is The weird part is, my 5 tests ran sequentially and the first one succeeded, but the second one failed by this issue, then the rest of the tests succeeded again, sometimes the order may be different. My request is: is it possible for |
I'll add the ability to configure retries to the Rules Unit Testing product backlog but it might take a while for the team to get to it since there's a viable workaround. I've removed the It might be worth opening an issue in firebase-tools repo, which hosts the emulators, since their Emulator Hub is what's closing the socket connection. I went to create an issue on your behalf but their issue templates requires more details than I have here (your firebase-cli version, etc.). Please do link to this issue when you create one there so that they know that we sent you. :) |
Operating System
Ubuntu 22.04
Environment (if applicable)
GitHub Actions
Firebase SDK Version
11.1.0
Firebase SDK Product(s)
Firestore
Project Tooling
React Native (Expo), Jest, TypeScript.
Detailed Problem Description
Hi Firebase team,
We recently occasionally have this error in our GitHub workflow, we've never had this issue in local device:
It seems
await fetchImpl(makeUrl(hub, '/emulators'));
indiscoverEmulators
throwed theSocketError: other side closed
and the codes didn't catch it then the codes crashed, can we retry whendiscoverEmulators
catches such an error?Our Github workflow is similar to below:
We invoke
initializeTestEnv
like below:We invoke it in each Jest unit test file in
beforeAll
, there are 5 Jest test files in our codebase, so this function is called 5 consecutive times.Steps and code to reproduce issue
N/A, this is an occasional issue and only observed in GitHub Actions workflows.
The text was updated successfully, but these errors were encountered: