Conversation
07c765c to
0607fe1
Compare
Configure the large Rust test targets with Bazel's native shard_count while keeping rules_rust's stable test-name hash bucket assignment. With rules_rs 0.0.58 available on main, this change only adds the Codex macro wiring and opts the selected large test targets into sharding. Co-authored-by: Codex <noreply@openai.com>
zbarsky-openai
approved these changes
Apr 17, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Why
The large Rust test suites are slow and include some of our flakiest tests, so we want to run them with Bazel native sharding while keeping shard membership stable between runs.
This is the simpler follow-up to the explicit-label experiment in #17998. Since #18397 upgraded Codex to
rules_rs0.0.58, which includes the stable test-name hashing support from hermeticbuild/rules_rust#14, this PR only needs to wire Codex's Bazel macros into that support.Using native sharding preserves BuildBuddy's sharded-test UI and Bazel's per-shard test action caching. Using stable name hashing avoids reshuffling every test when one test is added or removed.
What Changed
codex_rust_cratenow acceptstest_shard_countsand applies the right Bazel/rules_rust attributes to generated unit and integration test rules. Matched tests are also markedflaky = True, giving them Bazel's default three attempts.This PR shards these labels 8 ways:
Verification
bazel query --output=buildover the selected public labels and their inner unit-test binaries confirmed the expectedshard_count = 8,flaky = True, andexperimental_enable_sharding = Trueattributes.Also verified that we see the shards as expected in BuildBuddy so they can be analyzed independently.