Skip to content

Commit 9a95659

Browse files
Use Correct Enum in Wipe Snapshots Test Method
* Mistake was made in elastic#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 58e885c commit 9a95659

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;
@@ -544,7 +544,7 @@ private void wipeCluster() throws Exception {
544544
for (Object snapshot : snapshots) {
545545
Map<?, ?> snapshotInfo = (Map<?, ?>) snapshot;
546546
String name = (String) snapshotInfo.get("snapshot");
547-
if (SnapshotsInProgress.State.valueOf((String) snapshotInfo.get("state")).completed() == false) {
547+
if (SnapshotState.valueOf((String) snapshotInfo.get("state")).completed() == false) {
548548
inProgressSnapshots.computeIfAbsent(repoName, key -> new ArrayList<>()).add(snapshotInfo);
549549
}
550550
logger.debug("wiping snapshot [{}/{}]", repoName, name);

0 commit comments

Comments
 (0)