Skip to content

test: use maximal parallelization in full test run#9039

Merged
mikehardy merged 1 commit into
mainfrom
test-in-parallel
Jun 5, 2026
Merged

test: use maximal parallelization in full test run#9039
mikehardy merged 1 commit into
mainfrom
test-in-parallel

Conversation

@mikehardy

Copy link
Copy Markdown
Collaborator

Description

First in what should be a series of incremental improvements in change validation throughput

This parallelizes the various phases of a single test run which should improve full test run latency a bit

e2e is still serial for now

Release Summary

test only

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

it's made of tests

also it doesn't actually get exercised in CI anywhere so I'm just going to merge


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@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 optimizes the repository's full test suite execution by transitioning from sequential task execution to parallel processing. By leveraging background jobs and process waiting, the script now executes multiple verification and build tasks concurrently, improving overall throughput while maintaining robust error handling.

Highlights

  • Parallel Execution Helper: Introduced a new run_yarn_scripts_parallel function in the test script that manages background processes and waits for their completion, ensuring proper failure propagation and signal handling.
  • Test Pipeline Optimization: Refactored the full test execution script to run pod installations, builds, typechecks, linting, and unit tests in parallel, significantly reducing total execution time.
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.

@mikehardy mikehardy merged commit b22fb3a into main Jun 5, 2026
17 of 18 checks passed
@mikehardy mikehardy deleted the test-in-parallel branch June 5, 2026 01:11

@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 parallel execution for yarn scripts in scripts/run-full-tests.sh to speed up the test suite. Feedback focuses on preventing resource exhaustion by running heavy native builds sequentially rather than in parallel with lints and unit tests, and improving process termination safety by targeting specific background job PIDs instead of using kill 0.

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 scripts/run-full-tests.sh
Comment on lines +83 to +95
# 2–5. Builds, typechecks, lint, and unit tests (all parallel)
echo "Running builds, typechecks, lint, and unit tests in parallel..."
run_yarn_scripts_parallel \
"tests:ios:build" \
"tests:macos:build" \
"tests:android:build" \
"compare:types" \
"lint:js" \
"lint:ios:check" \
"lint:markdown" \
"lint:spellcheck" \
"tests:jest" \
|| { echo "Parallel verification failed"; exit 1; }

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.

high

Running 9 heavy tasks in parallel—especially three native builds (ios:build, macos:build, android:build) and tests:jest—will consume an immense amount of CPU and memory. On standard CI runners or even high-end developer machines, this is highly likely to cause severe resource contention, thrashing, or Out-Of-Memory (OOM) crashes.

A more balanced approach is to run the lighter linting, typechecking, and unit test tasks in parallel, while running the heavy native builds sequentially to avoid resource exhaustion.

Suggested change
# 2–5. Builds, typechecks, lint, and unit tests (all parallel)
echo "Running builds, typechecks, lint, and unit tests in parallel..."
run_yarn_scripts_parallel \
"tests:ios:build" \
"tests:macos:build" \
"tests:android:build" \
"compare:types" \
"lint:js" \
"lint:ios:check" \
"lint:markdown" \
"lint:spellcheck" \
"tests:jest" \
|| { echo "Parallel verification failed"; exit 1; }
# 2. Run lints, typechecks, and unit tests in parallel
echo "Running lints, typechecks, and unit tests in parallel..."
run_yarn_scripts_parallel \
"compare:types" \
"lint:js" \
"lint:ios:check" \
"lint:markdown" \
"lint:spellcheck" \
"tests:jest" \
|| { echo "Lints or unit tests failed"; exit 1; }
# 3. Run native builds (sequentially to avoid resource exhaustion)
echo "Verifying builds..."
run_yarn_script "tests:ios:build" || { echo "iOS build failed"; exit 1; }
run_yarn_script "tests:macos:build" || { echo "macOS build failed"; exit 1; }
run_yarn_script "tests:android:build" || { echo "Android build failed"; exit 1; }

Comment thread scripts/run-full-tests.sh
local pid failed=0

(
trap 'kill 0' SIGINT

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.

medium

Using kill 0 sends the termination signal to the entire process group. This can prematurely terminate the parent shell before it can run its own EXIT trap cleanly, or kill unrelated processes sharing the same process group.

A safer and more targeted approach is to explicitly kill only the background job PIDs stored in the pids array.

Suggested change
trap 'kill 0' SIGINT
trap 'kill "${pids[@]}" 2>/dev/null' SIGINT SIGTERM

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