Skip to content

Commit 1ee0ca3

Browse files
Use Correct Enum in Wipe Snapshots Test Method (#40422) (#40440)
* Mistake was made in #39662 * The response deserialized here is `org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse` which uses `org.elasticsearch.snapshots.SnapshotInfo` which uses `org.elasticsearch.snapshots.SnapshotState` and not the shard state
1 parent 3820f63 commit 1ee0ca3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import org.elasticsearch.client.RestClient;
3737
import org.elasticsearch.client.RestClientBuilder;
3838
import org.elasticsearch.client.WarningsHandler;
39-
import org.elasticsearch.cluster.SnapshotsInProgress;
4039
import org.elasticsearch.common.CheckedRunnable;
4140
import org.elasticsearch.common.Strings;
4241
import org.elasticsearch.common.io.PathUtils;
@@ -53,6 +52,7 @@
5352
import org.elasticsearch.common.xcontent.support.XContentMapValues;
5453
import org.elasticsearch.core.internal.io.IOUtils;
5554
import org.elasticsearch.rest.RestStatus;
55+
import org.elasticsearch.snapshots.SnapshotState;
5656
import org.elasticsearch.test.ESTestCase;
5757
import org.junit.After;
5858
import org.junit.AfterClass;
@@ -525,7 +525,7 @@ private void wipeCluster() throws Exception {
525525
for (Object snapshot : snapshots) {
526526
Map<?, ?> snapshotInfo = (Map<?, ?>) snapshot;
527527
String name = (String) snapshotInfo.get("snapshot");
528-
if (SnapshotsInProgress.State.valueOf((String) snapshotInfo.get("state")).completed() == false) {
528+
if (SnapshotState.valueOf((String) snapshotInfo.get("state")).completed() == false) {
529529
inProgressSnapshots.computeIfAbsent(repoName, key -> new ArrayList<>()).add(snapshotInfo);
530530
}
531531
logger.debug("wiping snapshot [{}/{}]", repoName, name);

0 commit comments

Comments
 (0)