Repository navigation
ci: Balance Tier 2 Linux shards by recorded test duration - #1049
Merged
Merged
Conversation
…1048) Fails: shard-plan.sh does not exist and validate.sh stripes tests with ctest -I.
ctest -I striped tests by number, so one shard ran tests for 153 s and another for 63 s. shard-plan.sh assigns tests longest-first to the lightest shard from ctest's cost data (in the Tier 2 ccache since #931); the build job writes one exact-name regex per shard into the packed tree (OBS_TIER2_SHARDS=3) and shards run ctest -R with it, striping only when no plan exists. On the real ON cost data: 154 s -> 92 s slowest shard.
This was referenced Oct 16, 2026
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.
Fixes #1048. Part of #930 / #937.
ctest -I <i>,,3striped tests by number: on master run 38874213546 the shards' test steps took 153 s (ON 3/3) against 63 s (OFF 2/3), and the slowest shard sets Tier 2's wall time.rust/tools/linux-validate/shard-plan.sh(bash/awk, no Python in the container): longest test first, each into the lightest shard, using ctest'sCTestCostData.txtformat; no recorded cost means 1 s. It writes<i>-of-<n>.regexexact-name regexes.OBS_TIER2_SHARDS=3in the workflow):ctest -Nnames +ctest-cost-<mode>.txtfrom the Tier 2 ccache (ci: Tier 2 Linux schedules slow tests first and runs 8 at a time (A3 of #930) #931) →<build>/tier2-shards/, packed with the tree.ctest -Rwith its shard's regex when the plan exists, else-Istriping.run.shpassesOBS_TIER2_SHARDS.Real ON cost data (260 tests): striping 49 / 73 / 154 s; balanced 92 / 92 / 92 s.
RED d04cbdf:
ci/test_tier2_shard_plan.py. GREEN 35ca849: 7/7,ci/suite green. A check caught that an empty cost file made every shard empty (awkFNR == NRmisreads an empty first file); fixed, with a regression test.Local end-to-end (Docker harness): build stage planned 255 tests into 91.9 s × 3 and packed the plan; a fresh volume with only the unpacked tree, shard 2/3, used the plan: 88 tests, 100% passed.
The cost data comes from runs before #975 (shards don't refresh it yet). It's still close, and a follow-up can have shards hand their timings back.