Compose flaky attribute with --flaky_test_attempts#13
Open
alexeagle wants to merge 1 commit into
Open
Conversation
…t_attempts. The flaky BUILD attribute now declares additional attempts when the flag is default, while a numeric --flaky_test_attempts value overrides total attempts for all matching targets including deterministic tests.
alexeagle
added a commit
to alexeagle/buildtools
that referenced
this pull request
Jul 2, 2026
Document timeout, flaky, and shard_count as execution-reflecting attrs; add shard_count recommender (future), integer flaky semantics from figma/bazel#13, and attr-policy maxValue for shard_count after figma/bazel#12.
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.
Summary
Bazel's
flakyBUILD attribute and--flaky_test_attemptsflag are disconnected: a global numeric flag applies the same retry count to every target (ignoringflaky=1), while the attribute only affects behavior when the flag is left atdefaultand cannot express degrees of flakiness. This makes it hard to declare per-target retry policy in BUILD files at scale.Upstream tracking issue: bazelbuild#30108
This change makes
flakyan integer (additional retry count when the flag isdefault) and clarifies how it composes with--flaky_test_attempts.Semantic changes
--flaky_test_attemptsflakydefault(unset)0/Falsedefault1/Truedefault2defaultN3)03)13)2flaky=True/flaky=Falsecontinue to work (True→ 1,False→ 0).Breaking changes / migration
flaky=1relying on 3 attempts under default flagflaky=2to restore 3 attempts--flaky_test_attempts=Nexpecting onlyflaky=1targets to retryregex@Nlists on the flagflaky=Nper target when flag isdefaultflaky=2or higher in BUILD filesTest plan
TestStrategyTest— flag override vs default compositionTestActionBuilderTest—flaky=True, integer values, negative rejectionTypeTest—FLAKY_TEST_RETRIESconversion and tagging