We have to wait for no more operations here not for `1`. This mostly worked because the test thread would add the listener quickly enough so that it sees the state where either the snapshot or clone but not both have already finished but randomly the test thread would be slow and time out on a state without snaphots in it.
This commit is contained in:
parent
c1071b1eb4
commit
e0f73c96f7
|
@ -559,7 +559,7 @@ public class CloneSnapshotIT extends AbstractSnapshotIntegTestCase {
|
|||
} finally {
|
||||
unblockNode(repoName, masterName);
|
||||
}
|
||||
awaitNumberOfSnapshotsInProgress(1);
|
||||
awaitNoMoreRunningOperations();
|
||||
|
||||
awaitMasterFinishRepoOperations();
|
||||
|
||||
|
|
|
@ -1298,10 +1298,6 @@ public class ConcurrentSnapshotsIT extends AbstractSnapshotIntegTestCase {
|
|||
return snapshotNames;
|
||||
}
|
||||
|
||||
private void awaitNoMoreRunningOperations() throws Exception {
|
||||
awaitNoMoreRunningOperations(internalCluster().getMasterName());
|
||||
}
|
||||
|
||||
private ActionFuture<AcknowledgedResponse> startDeleteFromNonMasterClient(String repoName, String snapshotName) {
|
||||
logger.info("--> deleting snapshot [{}] from repo [{}] from non master client", snapshotName, repoName);
|
||||
return internalCluster().nonMasterClient().admin().cluster().prepareDeleteSnapshot(repoName, snapshotName).execute();
|
||||
|
|
|
@ -467,6 +467,10 @@ public abstract class AbstractSnapshotIntegTestCase extends ESIntegTestCase {
|
|||
SnapshotsService.OLD_SNAPSHOT_FORMAT, Function.identity(), f));
|
||||
}
|
||||
|
||||
protected void awaitNoMoreRunningOperations() throws Exception {
|
||||
awaitNoMoreRunningOperations(internalCluster().getMasterName());
|
||||
}
|
||||
|
||||
protected void awaitNoMoreRunningOperations(String viaNode) throws Exception {
|
||||
logger.info("--> verify no more operations in the cluster state");
|
||||
awaitClusterState(viaNode, state -> state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).entries().isEmpty() &&
|
||||
|
|
Loading…
Reference in New Issue