[8.4.0] Add --experimental_cancel_concurrent_tests=on_failed
#26670
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 existing
--experimental_cancel_concurrent_tests
flag can be used to let Bazel cancel concurrent runs of the same test as soon as one run passes with--runs_per_test_detects_flakes
. This change turns the boolean-valued into an enum-valued flag that also accepts the valueon_failed
to instead cancel on the first failed run. This can be used to avoid reruns of flaky tests when the intention is to only detect flakes, not their probability of being flaky.Also fix the quirk that
--experimental_cancel_concurrent_tests
has no effect with default Bazel settings since theexclusive
test strategy is registered last and thus always wins. Perhaps surprisingly, this is the only effect of that incorrect registration order - all otherexclusive
logic is explicitly gated behind the value of--test_strategy
.RELNOTES[NEW]: The
--experimental_cancel_concurrent_tests
option now accepts the valueson_passed
,on_failed
andnever
and cancels concurrent test runs on the first matching result. If enabled, it's now effective by default and no longer requires--test_strategy=standalone
to be passed explicitly.Closes #26630.
PiperOrigin-RevId: 789203343
Change-Id: I5e7838fa3562a1137987efbf2235d22b122e3e51
(cherry picked from commit 205255c)
Closes #26638