Fix testStartCloneWithSuccessfulShardSnapshotPendingFinalization (#63966) (#64000)

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:
Armin Braun 2020-10-21 15:33:12 +02:00 committed by GitHub
parent c1071b1eb4
commit e0f73c96f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -559,7 +559,7 @@ public class CloneSnapshotIT extends AbstractSnapshotIntegTestCase {
} finally {
unblockNode(repoName, masterName);
}
awaitNumberOfSnapshotsInProgress(1);
awaitNoMoreRunningOperations();
awaitMasterFinishRepoOperations();

View File

@ -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();

View File

@ -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() &&