fix(ci): run release coverage in parallel and size it for the merge step - #224
Merged
Conversation
Run 30619680673 failed two ways in one step. The workflow hand-rolls its own pest invocation so it can add --coverage-clover, and in doing so it had dropped the --parallel flag the `coverage` composer script carries. That put the whole suite through a single process: 6115 tests in 3940s, pushing the job past an hour. It then died anyway. With every test in one process the coverage set is accumulated in the runner rather than split across workers, and php-code-coverage's Serializer asked for a further 1.6G on top of an already exhausted 4G limit: Allowed memory size of 4294967296 bytes exhausted (tried to allocate 1608519680 bytes) So restore --parallel, add the prepare and optimize steps the composer script runs before it, and raise the coverage configuration's limit to 8G against that measured shortfall. phpunit-coverage.xml is the only place that can set the limit -- PHPUnit applies <ini> through ini_set() at bootstrap, after PHP has read -d and --passthru-php -- so the value moves in lockstep with CoverageWorkflowTest. A new guard pins --parallel on both the workflow's coverage command and the `coverage` script, since the two drifting apart is what caused this. Co-Authored-By: Claude Opus 5 <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.
Problem
Run 30619680673 failed two ways in one step.
1. It ran serially. The workflow hand-rolls its own
pestinvocation so it can add--coverage-clover, and in doing so had drifted from thecoveragecomposer script — it was missing--parallel. That put all 6115 tests through a single process: 3940s, pushing the job past an hour.2. It then OOM'd anyway — after every test had passed:
Serial mode makes this worse in a non-obvious way: with one process there are no per-worker coverage sets, so the entire coverage graph accumulates in the runner and the Serializer's single largest allocation lands on top of an already-full 4G.
Changes
--parallelon the workflow's coverage command, plus theprepare/testbench optimizesteps thecoveragescript runs before it.phpunit-coverage.xml's limit4G→8Gagainst the measured shortfall above, with the comment rewritten to cite it. That file is the sole owner of the limit — PHPUnit applies<php><ini>viaini_set()at bootstrap, after PHP has parsed the command line, so it silently overrides both-d memory_limit=and paratest's--passthru-php.CoverageWorkflowTestin lockstep, and add a guard pinning--parallelon both the workflow command and thecoveragescript — the two drifting apart is what caused this.The root cause is duplication: the workflow re-implements a composer script. I couldn't collapse them (the workflow needs
--coverage-cloverand--stop-on-*), so the new test pins the one flag whose loss is catastrophic instead.Verification
composer preflight— green (phpstan, rector, pint, prettier, eslint, 6118 passed / 5 skipped).--parallel --coverage-cloverontests/Unit: produced a valid merged clover spanning all 2413 source files, confirming clover survives the parallel merge.Not verified: the full coverage job was not run locally, so 8G is sized from the crash's own numbers rather than a measured peak RSS of a successful parallel run. Parallel also shifts the profile — workers hold their own sets (~300MB each) and the parent merges them, so the parent peak should be lower than the serial case. The first green run on
mainis what confirms it.🤖 Generated with Claude Code