use of org.opensearch.common.util.concurrent.UncategorizedExecutionException in project OpenSearch by opensearch-project.
the class ConcurrentSnapshotsIT method testSnapshotRunsAfterInProgressDelete.
public void testSnapshotRunsAfterInProgressDelete() throws Exception {
final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode();
internalCluster().startDataOnlyNode();
final String repoName = "test-repo";
createRepository(repoName, "mock");
ensureGreen();
createIndexWithContent("index-test");
final String firstSnapshot = "first-snapshot";
createFullSnapshot(repoName, firstSnapshot);
blockMasterFromFinalizingSnapshotOnIndexFile(repoName);
final ActionFuture<AcknowledgedResponse> deleteFuture = startDeleteSnapshot(repoName, firstSnapshot);
waitForBlock(clusterManagerNode, repoName, TimeValue.timeValueSeconds(30L));
final ActionFuture<CreateSnapshotResponse> snapshotFuture = startFullSnapshot(repoName, "second-snapshot");
unblockNode(repoName, clusterManagerNode);
final UncategorizedExecutionException ex = expectThrows(UncategorizedExecutionException.class, deleteFuture::actionGet);
assertThat(ex.getRootCause(), instanceOf(IOException.class));
assertSuccessful(snapshotFuture);
}
Aggregations