Skip to content

Commit

Permalink
Use Correct Enum in Wipe Snapshots Test Method (elastic#40422)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
original-brownbear committed Mar 26, 2019
1 parent 5dcf8a6 commit df120fd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.WarningsHandler;
import org.elasticsearch.cluster.SnapshotsInProgress;
import org.elasticsearch.common.CheckedRunnable;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.PathUtils;
Expand All @@ -53,6 +52,7 @@
import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.core.internal.io.IOUtils;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.snapshots.SnapshotState;
import org.elasticsearch.test.ESTestCase;
import org.junit.After;
import org.junit.AfterClass;
Expand Down Expand Up @@ -525,7 +525,7 @@ private void wipeCluster() throws Exception {
for (Object snapshot : snapshots) {
Map<?, ?> snapshotInfo = (Map<?, ?>) snapshot;
String name = (String) snapshotInfo.get("snapshot");
if (SnapshotsInProgress.State.valueOf((String) snapshotInfo.get("state")).completed() == false) {
if (SnapshotState.valueOf((String) snapshotInfo.get("state")).completed() == false) {
inProgressSnapshots.computeIfAbsent(repoName, key -> new ArrayList<>()).add(snapshotInfo);
}
logger.debug("wiping snapshot [{}/{}]", repoName, name);
Expand Down

0 comments on commit df120fd

Please sign in to comment.