Skip to content

Commit 8440468

Browse files
authored
Fix testIndexDeletionDuringSnapshotCreationInQueue flaky test (#11726)
* Fix testIndexDeletionDuringSnapshotCreationInQueue flaky test Signed-off-by: Suraj Singh <surajrider@gmail.com> * Update comment Signed-off-by: Suraj Singh <surajrider@gmail.com> --------- Signed-off-by: Suraj Singh <surajrider@gmail.com>
1 parent bb3959d commit 8440468

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/src/internalClusterTest/java/org/opensearch/snapshots/DedicatedClusterSnapshotRestoreIT.java

+7
Original file line numberDiff line numberDiff line change
@@ -1457,6 +1457,13 @@ public void testIndexDeletionDuringSnapshotCreationInQueue() throws Exception {
14571457

14581458
clusterAdmin().prepareRestoreSnapshot("test-repo", "test-snap").get();
14591459
ensureGreen("test-idx");
1460+
1461+
// Wait for snapshot process to complete to prevent conflict with repository clean up
1462+
assertBusy(() -> {
1463+
SnapshotInfo snapshotInfo = getSnapshot("test-repo", "test-snap-2");
1464+
assertTrue(snapshotInfo.state().completed());
1465+
assertEquals(SnapshotState.PARTIAL, snapshotInfo.state());
1466+
}, 1, TimeUnit.MINUTES);
14601467
}
14611468

14621469
private long calculateTotalFilesSize(List<Path> files) {

0 commit comments

Comments
 (0)