Correct incorrect in `#testConflictErrorAndAnalysisError`, and make that test case resilient to either of the targets with conflicting actions "winning".
@@ -366,10 +366,12 @@ public class OutputArtifactConflictTest extends GoogleBuildIntegrationTestCase {
() -> buildTarget("//x:x", "//conflict:x", "//conflict:_objs/x/foo.pic.o"));
events.assertContainsError(
"file 'conflict/_objs/x/foo.pic.o' is generated by these conflicting actions:");
- // When two targets have conflicting artifacts, the first target named on the commandline "wins"
- // and is successfully built. All other targets fail analysis for conflicting with the first.
+ // When targets have conflicting artifacts, one of them "wins" and is successfully built. All
+ // of the other targets with conflicting artifacts fail.
+ assertThat(eventListener.failedTargetNames).contains("//x:x");
+ assertThat(eventListener.failedTargetNames).hasSize(2);
assertThat(eventListener.failedTargetNames)
- .containsExactly("//x:x", "//conflict:_objs/x/foo.pic.o");
+ .containsAnyOf("//conflict:x", "//conflict:_objs/x/foo.pic.o");
}
@Test
@@ -395,7 +397,7 @@ public class OutputArtifactConflictTest extends GoogleBuildIntegrationTestCase {
events.assertContainsError(
"/bin/x/y' (belonging to //x:y) is a prefix of output path 'blaze-out");
// When targets have conflicting artifacts, one of them "wins" and is successfully built. All
- // other targets fail analysis for conflicting with the first.
+ // of the other targets with conflicting artifacts fail.
assertThat(eventListener.failedTargetNames).containsAtLeast("//x:y", "//x/y:y");
assertThat(eventListener.failedTargetNames).hasSize(3);
assertThat(eventListener.failedTargetNames)
