Skip to content

ci: fix storage emulator integration tests on Node 24#10641

Open
joehan wants to merge 5 commits into
mainfrom
jh-fix-storage-emulator-node-24
Open

ci: fix storage emulator integration tests on Node 24#10641
joehan wants to merge 5 commits into
mainfrom
jh-fix-storage-emulator-node-24

Conversation

@joehan

@joehan joehan commented Jun 12, 2026

Copy link
Copy Markdown
Member

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

### 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
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

joehan added 4 commits June 12, 2026 11:35
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants