Skip to content

Commit

Permalink
Clear testSuiteImplicitTests before adding tests
Browse files Browse the repository at this point in the history
buildPartial can be called at least a second time in the event of a skyframe
restart (due to a missing dep) during package loading. This makes sure that
we don't double `$implicit_tests` when that happens.

PiperOrigin-RevId: 365136778
  • Loading branch information
michajlo authored and copybara-github committed Mar 25, 2021
1 parent 9ed03a2 commit 257e9ea
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,9 @@ private Builder beforeBuild(boolean discoverAssumedInputFiles) throws NoSuchPack
}

Collections.sort(tests); // (for determinism)
// In case we're called multiple times, as can happen in PackageFunction if skyframe deps are
// missing.
this.testSuiteImplicitTests.clear();
this.testSuiteImplicitTests.addAll(tests);

for (InputFile file : newInputFiles.values()) {
Expand Down

0 comments on commit 257e9ea

Please sign in to comment.