Skip to content

Commit c8bed7c

Browse files
Fix flaky test MasterServiceTests.testClusterStateUpdateLoggingWithDebugEnabled (#15204) (#15597)
* Fix test MasterServiceTests.testClusterStateUpdateLoggingWithDebugEnabled (cherry picked from commit b23c9de) Signed-off-by: Sumit Bansal <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 50f411e commit c8bed7c

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)