Clear testSuiteImplicitTests before adding tests
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.
@@ -1725,6 +1725,9 @@ public class Package {
}
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()) {
