Skip to content

ci: mutation-test on every core of the runner - #18

Merged
kasperg merged 1 commit into
mainfrom
ci/mutation-threads
Oct 14, 2026
Merged

kasperg merged 1 commit into
mainfrom
ci/mutation-threads

Conversation

@kasperg

@kasperg kasperg commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

The Mutation job passed --threads=max, which Infection turns into 80% of the cores, rounded down (CpuCoresCountProvider::CPU_USAGE_RATIO). GitHub's standard runners for private repositories have 2 vCPUs, so the job ran on one thread: "Running Infection with 1 thread", 4m 16s.

This lets THREADS set the thread count in make test-mutation, max by default, and has CI pass $(nproc).

Measured locally in Docker, all 814 mutations:

Run Time Result
1 thread, as CI ran 3m 56s 741 killed, 68 ignored, 3 errors, 2 timeouts, MSI 100%
1 thread, --only-covering-test-cases 3m 55s identical
2 threads 2m 15s identical

The errors and timeouts are the same at every thread count and in CI's own log, so they are not caused by running in parallel; Infection counts them as killed. --only-covering-test-cases saved nothing, so it is not added.

Public repositories get 4 vCPUs, where max would use 3 threads and $(nproc) uses 4. CuyZ/Valinor, openspout, maglnet/ComposerRequireChecker and others also run Infection with --threads=$(nproc) in CI.

Verified locally: make -n test-mutation expands THREADS as intended, and make lint-yaml lint-actions lint-commits pass. In this PR's own CI run, the Mutation job ran Infection with 2 threads in 3m 7s, against 4m 16s on one thread in the previous run, with the same 741 mutants killed. The gain is smaller than the local 43%.

The Mutation job passed --threads=max, which Infection turns into four
fifths of the cores, rounded down. GitHub's runners for private
repositories have two, so it ran on one thread and took over four
minutes.

Let THREADS set the thread count, max by default, and have CI pass
$(nproc). Locally, on ten cores, two threads took 2m 15s against
3m 56s for one, with the same 741 mutants killed. Running only the
covering test cases saved nothing, so that option stays off.

Public repositories get four cores, where max would use three and
$(nproc) uses all four. CuyZ/Valinor, openspout and others run
Infection with --threads=$(nproc) in CI as well.

Assisted-by: Claude <noreply@anthropic.com>
@kasperg
kasperg merged commit a55f593 into main Oct 14, 2026
15 checks passed
@kasperg
kasperg deleted the ci/mutation-threads branch October 28, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant