Skip to content

Commit

Permalink
Fix SnapshotStatusApisIT#testInfiniteTimeout (elastic#108294)
Browse files Browse the repository at this point in the history
Make sure that the create-snapshot task completes on the master node before
we start checking the status of the snapshot

Resolve elastic#107405

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
arteam and elasticmachine authored May 6, 2024
1 parent d90c0af commit a049496
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.elasticsearch.cluster.SnapshotsInProgress;
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.Priority;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
Expand Down Expand Up @@ -700,6 +701,8 @@ public void testInfiniteTimeout() throws Exception {
.execute();
try {
waitForBlockOnAnyDataNode("test-repo");
// Make sure that the create-snapshot task completes on master
assertFalse(clusterAdmin().prepareHealth().setWaitForEvents(Priority.LANGUID).get().isTimedOut());
final List<SnapshotStatus> snapshotStatus = clusterAdmin().prepareSnapshotStatus("test-repo")
.setMasterNodeTimeout(TimeValue.MINUS_ONE)
.get()
Expand Down

0 comments on commit a049496

Please sign in to comment.