Skip to content

test: mitigate functions timeout, storage seed, and FIS e2e flakes#9078

Merged
mikehardy merged 7 commits into
mainfrom
e2e-deflake-part-3
Jun 27, 2026
Merged

test: mitigate functions timeout, storage seed, and FIS e2e flakes#9078
mikehardy merged 7 commits into
mainfrom
e2e-deflake-part-3

Conversation

@mikehardy

@mikehardy mikehardy commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Description

Reduces recurring e2e flakes on the shared react-native-firebase-testing project:

  • Storage — fixture seed retries with exponential backoff when the emulator is briefly unavailable.
  • Functions emulator — longer client callable timeouts in functions.e2e.js and 120s timeoutSeconds on workflow test callables (complements the merged macOS/web httpsCallable unit fix).
  • FIS / Installations quota — Detox-level retry with cooldown for live API pressure; xdescribe duplicate namespaced suites in installations and remote-config; cloud-pressure metrics via deployed e2eCloudMetricsV2 / e2eCloudMetricsSummaryV2 (Cloud Logging, not the Functions emulator); cloud-pressure-analysis log pointer on quota failure instead of dumping 24h summaries inline.
  • Jet launch gate — defer server.run() until launchApp succeeds; host control HTTP on 8091 (8090 stays WebSocket-only).
  • Orchestration race — kill/respawn Jet on launch retry; orchestrate-state logging and enriched disconnect_context for CI triage.
  • iOS CI load gatewait-for-load-settle.sh immediately before Detox (threshold 20, 1200s max wait).
  • iOS CI baseload shrink — drop host syslog and unfiltered sim log; one filtered sim-app.log stream (testing + SpringBoard/invertase); host + sim video only when workflow_dispatch / workflow_call input record_screens: true (default false).
  • Simulator instrumentation — shared simulator-logging.sh; boot-simulator logs/full modes; flake-summary + resource-monitor orchestrate-state and log-stream sentinels.
  • Android coverage / launch — Detox FabricTimersIdlingResource patch for New Architecture stability; delete processed .ec after Jacoco export (parity with iOS profraw).
  • OKF runbooks — cloud vs emulator paths, canonical e2e pre-flight, Jet 8090/8091 orchestration, and iOS CI baseload policy (sim-app.log, load settle, record_screens).

Related issues

CI e2e flake triage on shared testing project (Installations 503 / “Too many server requests”, storage seed failures, functions emulator DEADLINE_EXCEEDED / network flakes, Jet/Detox orchestration races and macOS runner load on iOS CI).

Release Summary

No user-facing library changes.

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/**/e2e
    • jest tests added or updated in packages/**/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

  • Focused iOS e2e (app + installations harness): 49 passing, 3 pending (xdescribe v8)
  • Deployed e2e cloud helpers via .github/workflows/scripts/deploy-e2e-cloud-functions.sh; verified e2eCloudMetricsSummaryV2 returns structured byCategory (not unknown)
  • Local iOS orchestration validation: defer-run sequence (launch-ready → tests-run-permitted) and Jet control on 8091
  • iOS CI with baseload shrink: reduced runner instrumentation; load settle + Detox orchestration validated on GHA
  • Full matrix e2e (iOS / Android / macOS) — CI on merge

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses recurring end-to-end test flakes in the shared react-native-firebase-testing project. By introducing robust retry mechanisms, adjusting timeouts, and adding observability for cloud API pressure, the changes aim to stabilize the CI pipeline across iOS, Android, and macOS platforms.

Highlights

  • Storage Seeding: Added exponential backoff to storage fixture seeding to handle emulator unavailability.
  • Functions Timeouts: Increased client-side timeouts for callable functions to prevent deadline-exceeded errors under CI load.
  • Cloud API Quota Management: Implemented retry logic with cooldowns and cloud-pressure metrics to mitigate 503 errors during high-traffic end-to-end testing.
  • Documentation: Updated OKF runbooks and CI triage guides to include cloud API quota handling and host-clear probe procedures.
Ignored Files
  • Ignored by pattern: .github/workflows/** (13)
    • .github/workflows/scripts/deploy-e2e-cloud-functions.sh
    • .github/workflows/scripts/deploy-remote-config-function.sh
    • .github/workflows/scripts/functions/package.json
    • .github/workflows/scripts/functions/src/e2eCallOptions.ts
    • .github/workflows/scripts/functions/src/e2eCloudMetrics.ts
    • .github/workflows/scripts/functions/src/fetchAppCheckToken.ts
    • .github/workflows/scripts/functions/src/index.ts
    • .github/workflows/scripts/functions/src/sendFCM.ts
    • .github/workflows/scripts/functions/src/testFunctionCustomRegion.ts
    • .github/workflows/scripts/functions/src/testFunctionDefaultRegion.ts
    • .github/workflows/scripts/functions/src/testFunctionRemoteConfigUpdate.ts
    • .github/workflows/scripts/functions/src/testStreamingCallable.ts
    • .github/workflows/scripts/functions/yarn.lock
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces mitigations and observability for live Firebase cloud API quota pressure in CI workflows, including a cooldown retry mechanism for quota failures, skipping namespaced v8 compatibility tests to reduce load, extending functions emulator timeouts, and adding exponential backoff to storage seeding. It also updates documentation regarding host-clear probes and pre-flight recovery. Feedback on the changes suggests referencing global.FirebaseHelpers directly instead of this in the new global helper methods to prevent potential context loss if they are destructured.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tests/globals.js
Comment thread tests/globals.js
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.53%. Comparing base (79d97f0) to head (2da4309).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9078      +/-   ##
==========================================
- Coverage   68.46%   64.53%   -3.93%     
==========================================
  Files         301      364      +63     
  Lines       15878    25489    +9611     
  Branches     3363     4272     +909     
==========================================
+ Hits        10870    16447    +5577     
- Misses       4850     8513    +3663     
- Partials      158      529     +371     
Flag Coverage Δ
android-native 28.17% <ø> (-0.44%) ⬇️
e2e-ts-android 28.17% <ø> (-0.44%) ⬇️
e2e-ts-ios 49.12% <ø> (?)
e2e-ts-macos 39.79% <ø> (-0.35%) ⬇️
ios-native 49.12% <ø> (?)
jest 65.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mikehardy mikehardy force-pushed the e2e-deflake-part-3 branch from 98413ee to 65d82bc Compare June 27, 2026 00:28
@mikehardy mikehardy force-pushed the e2e-deflake-part-3 branch from 65d82bc to ced081f Compare June 27, 2026 01:21
@mikehardy mikehardy force-pushed the e2e-deflake-part-3 branch from ced081f to 2da4309 Compare June 27, 2026 01:54
@mikehardy mikehardy merged commit 24c96f8 into main Jun 27, 2026
23 checks passed
@mikehardy mikehardy deleted the e2e-deflake-part-3 branch June 27, 2026 01:59
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.

1 participant