You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No JDK causes emulators:exec to immediately exit with a success code #7974
I was seeing unexpected success on a test suite, it turns out I did not have the JDK installed correctly on my new machine.
When failures such as this occur firebase emulators:exec "exit 1" returns a success code and only i emulators: Shutting down emulators.
I didn't see I what the issue was until I used --debug. This could be a footgun for those using the emulators for integration tests. Having seen this I expect there may be similar classes of errors.
changed the title [-]No JDK causes emulators:exec to immediately exit with a successful error code & no useful error[/-][+]No JDK causes emulators:exec to immediately exit with a successful error code[/+]on Nov 20, 2024
changed the title [-]No JDK causes emulators:exec to immediately exit with a successful error code[/-][+]No JDK causes emulators:exec to immediately exit with a success code[/+]on Nov 20, 2024
Thanks for raising this @jamesdaniels. I'm able to reproduce the issue. As you mentioned, this would cause a false positive on integration tests if the user doesn't have JDK installed, or if it was incorrectly installed in their machine.
I'll mark this as reproducible and discuss this with some of our colleagues.
Hey @erayerdin, I tried to reproduce this issue again and running firebase emulators:exec "exit 1" outputs a non-zero exit code:
$ firebase --version
14.2.0
$ firebase emulators:exec "exit 1"
i emulators: Shutting down emulators.
Error: Could not spawn `java -version`. Please make sure Java is installed and on your system PATH.
$ echo $?
1
I think the issue might be related to how the Playwright test script fails. Could you open a new issue and provide details on how you set up your tests?
Activity
[-]No JDK causes emulators:exec to immediately exit with a successful error code & no useful error[/-][+]No JDK causes emulators:exec to immediately exit with a successful error code[/+][-]No JDK causes emulators:exec to immediately exit with a successful error code[/-][+]No JDK causes emulators:exec to immediately exit with a success code[/+]aalej commentedon Nov 20, 2024
Thanks for raising this @jamesdaniels. I'm able to reproduce the issue. As you mentioned, this would cause a false positive on integration tests if the user doesn't have JDK installed, or if it was incorrectly installed in their machine.
I'll mark this as reproducible and discuss this with some of our colleagues.
joehan commentedon Nov 20, 2024
Thanks for catching this James - looks like we broke this while trying to fix a different issue that was breaking error reporting in the VSCode extension - https://github.com/firebase/firebase-tools/blob/master/src/emulator/commandUtils.ts#L471 is catching the error so it can message the extension, but it never rethrows it.
PR incoming shortly to fix this
erayerdin commentedon May 1, 2025
Issue still persist. Although Playwright fails with tests, the exit code is zero.
Also, as @jamesdaniels suggested, trying
firebase emulators:exec "exit 1"also does not lead non-zero exit code.aalej commentedon May 5, 2025
Hey @erayerdin, I tried to reproduce this issue again and running
firebase emulators:exec "exit 1"outputs a non-zero exit code:I think the issue might be related to how the Playwright test script fails. Could you open a new issue and provide details on how you set up your tests?