[7.x] Also expect RELOCATING in RecoveryIT.testRecoveryClosedIndex (#49090) (#49154)

In addition to the fix in #48506, it seems we could also get the
`RELOCATING` state.

This fixes the failure in
 https://gradle-enterprise.elastic.co/s/svjmmvqk32cii/tests/ua7icdau7nz6y-2cwvhj3qg5qou?openStackTraces=WzBd
This commit is contained in:
Dimitris Athanasiou 2019-11-15 15:56:53 +02:00 committed by GitHub
parent 89b3c32b40
commit a000d868a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,13 +57,13 @@ import static com.carrotsearch.randomizedtesting.RandomizedTest.randomAsciiOfLen
import static org.elasticsearch.cluster.routing.UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING;
import static org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider.INDEX_ROUTING_ALLOCATION_ENABLE_SETTING;
import static org.elasticsearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider.SETTING_ALLOCATION_MAX_RETRY;
import static org.hamcrest.Matchers.either;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.isIn;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.oneOf;
/**
* In depth testing of the recovery mechanism during a rolling restart.
@ -597,7 +597,7 @@ public class RecoveryIT extends AbstractRollingTestCase {
for (Map<String, ?> shard : shards) {
assertThat(XContentMapValues.extractValue("shard", shard), equalTo(i));
assertThat((String) XContentMapValues.extractValue("state", shard),
either(equalTo("STARTED")).or(equalTo("RELOCATED")));
oneOf("STARTED", "RELOCATING", "RELOCATED"));
assertThat(XContentMapValues.extractValue("index", shard), equalTo(index));
}
}