The retention run goes through a number of steps and can randomly take more than 10s. => increased timeout to 30s like we did in other spots in this test Also, noticed that we had a hard wait of 10s in this test, removed it and adjusted following busy assert in a way that can deal with a missing snapshot (from when the assert runs before the snapshot was put into the CS). Closes #60336
This commit is contained in:
parent
76359aaa53
commit
bfee7b91ff
|
@ -363,14 +363,18 @@ public class SLMSnapshotBlockingIntegTests extends AbstractSnapshotIntegTestCase
|
|||
logger.info("--> waiting for snapshot to complete");
|
||||
successfulSnapshotName.set(snapshotResponse.get().getSnapshotName());
|
||||
assertNotNull(successfulSnapshotName.get());
|
||||
Thread.sleep(TimeValue.timeValueSeconds(10).millis());
|
||||
logger.info("--> verify that snapshot [{}] succeeded", successfulSnapshotName.get());
|
||||
assertBusy(() -> {
|
||||
GetSnapshotsResponse snapshotsStatusResponse = client().admin().cluster()
|
||||
.prepareGetSnapshots(REPO).setSnapshots(successfulSnapshotName.get()).get();
|
||||
SnapshotInfo snapshotInfo = snapshotsStatusResponse.getSnapshots().get(0);
|
||||
final SnapshotInfo snapshotInfo;
|
||||
try {
|
||||
final GetSnapshotsResponse snapshotsStatusResponse = client().admin().cluster()
|
||||
.prepareGetSnapshots(REPO).setSnapshots(successfulSnapshotName.get()).execute().actionGet();
|
||||
snapshotInfo = snapshotsStatusResponse.getSnapshots().get(0);
|
||||
} catch (SnapshotMissingException sme) {
|
||||
throw new AssertionError(sme);
|
||||
}
|
||||
assertEquals(SnapshotState.SUCCESS, snapshotInfo.state());
|
||||
});
|
||||
}, 30L, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
// Check that the failed snapshot from before still exists, now that retention has run
|
||||
|
@ -401,7 +405,7 @@ public class SLMSnapshotBlockingIntegTests extends AbstractSnapshotIntegTestCase
|
|||
.prepareGetSnapshots(REPO).setSnapshots(successfulSnapshotName.get()).get();
|
||||
SnapshotInfo snapshotInfo = snapshotsStatusResponse.getSnapshots().get(0);
|
||||
assertEquals(SnapshotState.SUCCESS, snapshotInfo.state());
|
||||
});
|
||||
}, 30L, TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue