Skip to content

Commit

Permalink
[7.2.0] Only check for shard status file if a test passed (#22143)
Browse files Browse the repository at this point in the history
If a test fails, the failure is going to be informative than a generic
exec error and the failure may have interrupted or prevented the test
runner from touching the status file.

Speculatively fixes #22028

Closes #22098.

PiperOrigin-RevId: 628355694
Change-Id: I370c7aba331f2a7a89cb9a9ff99d32b1694fd03a

Commit
874a050

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
  • Loading branch information
bazel-io and fmeum committed May 8, 2024
1 parent e43efb3 commit e47175a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,10 @@ private TestAttemptResult runTestAttempt(
}
long endTimeMillis = actionExecutionContext.getClock().currentTimeMillis();

if (testAction.isSharded()) {
// Do not override a more informative test failure with a generic failure due to the missing
// shard file, which may have been caused by the test failing before the runner had a chance to
// touch the file
if (testResultDataBuilder.getTestPassed() && testAction.isSharded()) {
if (testAction.checkShardingSupport()
&& !actionExecutionContext
.getPathResolver()
Expand Down

0 comments on commit e47175a

Please sign in to comment.