ci: fix storage emulator integration tests on Node 24#10641
Open
joehan wants to merge 5 commits into
Open
Conversation
### Description On Node 24, running storage-emulator-integration conformance tests via a single wildcard mocha conformance/*.test.ts causes sequential test suites to fail to bind ports (4000, 9199, etc.) because previous emulator subprocesses and OS sockets have not fully completed teardown upon SIGINT. When this happened, admin SDK initialization was skipped, causing admin.app().delete() in the after() hook to throw an uncaught exception (The default Firebase app does not exist). This skipped subsequent cleanup steps (including browser and emulator controller shutdown) and left orphaned processes running for 2.5 hours until GitHub Actions cancelled the job. This PR addresses this by: 1. Adding a 2.5s buffer in CLIProcess.stop() after process exit to give orphaned children and OS sockets time to clear. 2. Updating storage-emulator-integration/run.sh to execute conformance tests individually with sleep 5 in between (matching how all other test suites in run.sh are run). 3. Making after() cleanup hooks in conformance tests resilient with try/catch blocks so they don't throw uncaught exceptions if admin or browser initialization was skipped. ### Scenarios Tested - Verified storage-emulator-integration tests and cleanup hooks run correctly. ### Sample Commands None
Contributor
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
Add explanatory comments inside empty catch blocks to satisfy ESLint's no-empty rule.
…IPv6 resolution In modern Chrome and Node.js 24 environment: 1. When running Chrome as root inside CI/Docker containers, --no-sandbox and --disable-setuid-sandbox are required to prevent startup timeouts. 2. Under Node 24, localhost resolves to IPv6 (::1), whereas Chrome DevTools listens on IPv4 (127.0.0.1). Adding --remote-debugging-address=127.0.0.1 explicitly binds Chrome DevTools to IPv4, preventing connection timeouts. 3. Added --disable-dev-shm-usage to prevent out-of-memory crashes in limited shared memory (/dev/shm) containers.
…onnection timeouts Replacing TCP network DevTools communication with underlying OS file descriptor pipes (pipe: true) makes Puppeteer incredibly robust, fully immune to port collisions, and fully avoids the regular expression console parsing timeout. Also added dumpio: true to surface underlying browser logs in CI.
On Ubuntu 22.04, executing Chrome CFT via Puppeteer with pipe: true causes fd 3/4 clashes with internal Chrome processes (like Zygote or GPU), throwing a fatal core startup crash (Invalid file descriptor to ICU data received.). This PR reverts pipe: true and restores standard WebSockets while retaining dumpio: true and adding headless: 'new' and --disable-software-rasterizer. This prevents both the software rasterization lockup and old headless mode deprecation timeouts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On Node 24, running storage-emulator-integration conformance tests via a single wildcard mocha conformance/*.test.ts causes sequential test suites to fail to bind ports (4000, 9199, etc.) because previous emulator subprocesses and OS sockets have not fully completed teardown upon SIGINT. When this happened, admin SDK initialization was skipped, causing admin.app().delete() in the after() hook to throw an uncaught exception (The default Firebase app does not exist). This skipped subsequent cleanup steps (including browser and emulator controller shutdown) and left orphaned processes running for 2.5 hours until GitHub Actions cancelled the job.
This PR addresses this by:
Scenarios Tested
Sample Commands
None