Repository navigation
ci: mutation-test on every core of the runner - #18
Merged
Merged
Conversation
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>
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.
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
THREADSset the thread count inmake test-mutation,maxby default, and has CI pass$(nproc).Measured locally in Docker, all 814 mutations:
--only-covering-test-casesThe 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-casessaved nothing, so it is not added.Public repositories get 4 vCPUs, where
maxwould 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-mutationexpandsTHREADSas intended, andmake lint-yaml lint-actions lint-commitspass. 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%.