Skip to content

Commit b23c9de

Browse files
authored
Fix flaky test MasterServiceTests.testClusterStateUpdateLoggingWithDebugEnabled (opensearch-project#15204)
* Fix test MasterServiceTests.testClusterStateUpdateLoggingWithDebugEnabled Signed-off-by: Sumit Bansal <[email protected]>
1 parent 9f81479 commit b23c9de

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/src/test/java/org/opensearch/cluster/service/MasterServiceTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,8 @@ public void onFailure(String source, Exception e) {
534534
});
535535
assertBusy(mockAppender::assertAllExpectationsMatched);
536536
// verify stats values after state is published
537-
assertEquals(1, clusterManagerService.getClusterStateStats().getUpdateSuccess());
538-
assertEquals(0, clusterManagerService.getClusterStateStats().getUpdateFailed());
537+
assertBusy(() -> assertEquals(1, clusterManagerService.getClusterStateStats().getUpdateSuccess()));
538+
assertBusy(() -> assertEquals(0, clusterManagerService.getClusterStateStats().getUpdateFailed()));
539539
}
540540
}
541541
}
@@ -699,8 +699,8 @@ public void onFailure(String source, Exception e) {
699699
});
700700
assertBusy(mockAppender::assertAllExpectationsMatched);
701701
// verify stats values after state is published
702-
assertEquals(1, clusterManagerService.getClusterStateStats().getUpdateSuccess());
703-
assertEquals(0, clusterManagerService.getClusterStateStats().getUpdateFailed());
702+
assertBusy(() -> assertEquals(1, clusterManagerService.getClusterStateStats().getUpdateSuccess()));
703+
assertBusy(() -> assertEquals(0, clusterManagerService.getClusterStateStats().getUpdateFailed()));
704704
}
705705
}
706706
}

0 commit comments

Comments
 (0)