Skip to content

Commit 8096a31

Browse files
authored
Bugfix flaky test assertion in testUpdateClusterNoDiff (#12222)
Signed-off-by: kcruz28 <kcruz28@illinois.edu>
1 parent fcc675d commit 8096a31

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cluster-operator/src/test/java/io/strimzi/operator/cluster/operator/assembly/KafkaMirrorMaker2AssemblyOperatorPodSetTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,8 @@ public void testUpdateClusterNoDiff(VertxTestContext context) {
634634

635635
assertThat(mm2Status.getUrl(), is("http://my-mm2-mirrormaker2-api.my-namespace.svc:8083"));
636636
assertThat(mm2Status.getReplicas(), is(3));
637-
assertThat(mm2Status.getLabelSelector(), is("strimzi.io/cluster=my-mm2,strimzi.io/name=my-mm2-mirrormaker2,strimzi.io/kind=KafkaMirrorMaker2"));
637+
// Compare as Sets to avoid order-dependent flakiness due to HashMap iteration order in labelSelector
638+
assertThat(Set.of(mm2Status.getLabelSelector().split(",")), is(Set.of("strimzi.io/cluster=my-mm2", "strimzi.io/name=my-mm2-mirrormaker2", "strimzi.io/kind=KafkaMirrorMaker2")));
638639
assertThat(mm2Status.getConditions().get(0).getStatus(), is("True"));
639640
assertThat(mm2Status.getConditions().get(0).getType(), is("Ready"));
640641

0 commit comments

Comments
 (0)