Skip to content

Commit

Permalink
Only check for shard status file if a test passed
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
  • Loading branch information
fmeum authored and Copybara-Service committed Apr 26, 2024
1 parent 5e63f2d commit 874a050
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 874a050

Please sign in to comment.