Repository navigation
CI: stop running the .exar1 sweeps twice per job - #25
Merged
Merged
Conversation
Measured on ubuntu-latest / Python 3.14, one job was 1817 s and split
almost exactly in half:
Test (pytest -q -n auto) 940 s 51.7%
The .exar1 archives must be present and ... 835 s 46.0%
everything else 42 s 2.3%
The second step ran `pytest tests/test_exar.py tests/test_exar_patch.py`
serially and then the first re-ran all of it in parallel. It tested
nothing the Test step did not; it existed only to tee its output and grep
it for `skipped`, because xdist workers interleave stdout. test_exar_patch
carries the two corpus sweeps (400 s and 199 s), so that guard was
carrying almost the whole cost -- the OCR and front-end guards do the same
thing for 4 s and 3 s because their files are small.
The Test step now writes a JUnit report and one new step asserts from it
that each guarded group ran. The report is written by the xdist
*controller* and aggregates the workers, so it carries per-test skip
status that interleaved stdout cannot, which is what lets the serial runs
go. Verified: under -n 4 the XML records a skip per test with its reason
and a suite-level count.
Every environment-discovery check is untouched and still fails fast --
tesseract must be findable, node --version must work, EXAR_FILES must be
non-empty. Only the "and were then exercised" half moved.
The new guard is stricter than the greps it replaces. `grep -q skipped
ocr.log` asks whether a file's output holds that word anywhere; this names
the tests that must have run, counts them, and reports which ones skipped.
Against the real full-suite report it sees 3 OCR, 12 front-end and 709
.exar1 tests ran with none skipped, and correctly ignores the suite's 26
legitimate skips in tests.test_scans. Falsified four ways: healthy exits
0; exar skipped exits 1 naming the tests; exar not collected at all exits
1 with a distinct message; one OCR test skipping among several exits 1
naming it.
Expected effect is ~835 s off each of the six matrix jobs. This run is
the measurement -- a workflow change cannot be checked any other way.
.gitignore swaps ocr.log, which nothing writes now, for results.xml.
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.
The measurement
One job on
ubuntu-latest / Python 3.14was 1817 s, split almost exactly in half:Test(pytest -q -n auto)The .exar1 archives must be present and exercisedThat second step ran
pytest tests/test_exar.py tests/test_exar_patch.pyserially, and theTeststep then re-ran all of it in parallel. It tested nothing theTeststep did not — it existed only toteeits output andgrep -q skipped, because xdist workers interleave stdout.test_exar_patch.pycarries the two corpus sweeps (400 s and 199 s), so that one guard was carrying nearly the whole cost. The OCR and front-end guards do exactly the same thing for 4 s and 3 s, because their files are small.The change
Testnow writes a JUnit report, and one new step asserts from it that each guarded group ran. The report is written by the xdist controller and aggregates the workers, so it carries per-test skip status that interleaved stdout cannot — which is precisely what let the serial runs go.Every environment-discovery check is untouched and still fails fast: tesseract must be findable,
node --versionmust work,EXAR_FILESmust be non-empty. Only the "and were then exercised" half moved to after the suite.It is stricter than what it replaces
grep -q skipped ocr.logasks whether a file's output holds that word anywhere. The new guard names the tests that must have run, counts them, and reports which ones skipped.Against the real full-suite report it sees 3 OCR, 12 front-end and 709
.exar1tests ran, none skipped, and correctly ignores the suite's 26 legitimate skips, which are all intests.test_scansand outside the guarded groups.Verification
--junit-xmlrecords skips correctly — checked rather than assumed: under-n 4, the XML carries a per-test<skipped>with its reason plus a suite-level count.::error::so--log-failedsurfaces the one useful line.Expected effect
~835 s off each of the six matrix jobs — ubuntu/3.14 from 1817 s to roughly 985 s. This PR's own CI run is the measurement; a workflow change cannot be checked any other way, so compare its step timings against the numbers above before merging.
Not addressed here: the
Teststep's own 940 s, of which the single 400 s self-drive sweep is 42%. Both big sweeps loopEXAR_PROTOCOL_FILESinternally over 26 evenly-sized pairs, so parametrising them would let xdist distribute the work — but they assert global tallies for non-vacuity, and splitting them needs a separate pin on the pair count or a corpus that shrank to zero cases would pass as0 passed..gitignoreswapsocr.log, which nothing writes now, forresults.xml.🤖 Generated with Claude Code