[CI] Unify unit test parallelism across Linux and Windows - #3800
Merged
Conversation
The "Unit Tests" workflow ran packages differently depending on the OS: Linux used GNU `parallel`, Windows fell back to a sequential loop because `parallel` isn't available there. That made the two Windows jobs by far the slowest in the matrix (~326s and ~305s, versus ~85-107s on Linux for the same suites). Replace both code paths with a single portable Bash function, `_run_package_tests`, that caps concurrency using only Bash job control (background jobs, `wait -n`, `jobs -rp`). It behaves the same on Linux and on Windows (Git Bash), needs no external tool, and reuses the existing `_run_task_sequential` helper. This supersedes the rust-parallel attempt from symfony#2997, which had to be abandoned because rust-parallel could not be forced to use bash on Windows. Claude-Session: https://claude.ai/code/session_01HrLP3NMLNUXLTcHjVXG8uo
Kocal
force-pushed
the
ci-parallelize-tests
branch
from
August 21, 2026 21:28
c9fbf97 to
598bd0e
Compare
Kocal
added a commit
that referenced
this pull request
Aug 24, 2026
The parallel pool added in #3800 (_run_package_tests in .github/workflows/.utils.sh) wasn't errexit-safe, and the Unit Tests step runs under `bash -e -o pipefail`. When a package's suite failed, its background subshell could abort under errexit before its exit code was written to the .rc file, and the throttle's `wait -n` could then abort the whole step under errexit before the replay loop printed any per-package logs. The result was a bare "Process completed with exit code 2" with no per-package output, so there was no way to tell which package failed. It was intermittent: it only happened when the failing job got reaped by `wait -n` in the throttle instead of the final `wait`. Fix _run_package_tests to be errexit-safe: capture the task's exit code with `|| code=$?` so the subshell isn't aborted before recording it, and guard the throttle's `wait -n` with `|| :` so a failed job doesn't abort the step early. A failing package now yields a clean step exit code of 1 with the full grouped logs, including the KO block naming the package that failed. Claude-Session: https://claude.ai/code/session_01HrLP3NMLNUXLTcHjVXG8uo
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.
Alternative to #2997
The "Unit Tests" workflow ran packages differently depending on the
OS: Linux used GNU
parallel, Windows fell back to a sequentialloop because
parallelisn't available there. That made the twoWindows jobs by far the slowest in the matrix (~326s and ~305s,
versus ~85-107s on Linux for the same suites).
Replace both code paths with a single portable Bash function,
_run_package_tests, that caps concurrency using only Bash jobcontrol (background jobs,
wait -n,jobs -rp). It behaves thesame on Linux and on Windows (Git Bash), needs no external tool,
and reuses the existing
_run_task_sequentialhelper. Thissupersedes the rust-parallel attempt from #2997, which had to be
abandoned because rust-parallel could not be forced to use bash on
Windows.
By comparing https://github.com/symfony/ux/actions/runs/32469165022?pr=3799 and https://github.com/symfony/ux/actions/runs/32528673415?pr=3800, tests are going from ~4m30s to ~1m30s-2m30s 🚀