test: use maximal parallelization in full test run#9039
Conversation
Summary of ChangesHello, 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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
| # 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; } |
There was a problem hiding this comment.
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.
| # 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; } |
| local pid failed=0 | ||
|
|
||
| ( | ||
| trap 'kill 0' SIGINT |
There was a problem hiding this comment.
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.
| trap 'kill 0' SIGINT | |
| trap 'kill "${pids[@]}" 2>/dev/null' SIGINT SIGTERM |
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
AndroidiOSOther(macOS, web)e2etests added or updated inpackages/\*\*/e2ejesttests added or updated inpackages/\*\*/__tests__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-firebaseis great? Please consider supporting the project with any of the below:React Native FirebaseandInvertaseon Twitter