Fix sporadic failures in testCorruptedShards (#27613)
Add assertBusy() to retry in case the shards are not yet all failed, and remove `@AwaitsFix`. Resolves #12416.
This commit is contained in:
parent
f123785d34
commit
5060007d20
|
@ -152,7 +152,6 @@ public class IndicesShardStoreRequestIT extends ESIntegTestCase {
|
|||
assertThat(shardStatuses.get(index1).size(), equalTo(2));
|
||||
}
|
||||
|
||||
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/12416")
|
||||
public void testCorruptedShards() throws Exception {
|
||||
String index = "test";
|
||||
internalCluster().ensureAtLeastNumDataNodes(2);
|
||||
|
@ -189,6 +188,7 @@ public class IndicesShardStoreRequestIT extends ESIntegTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
assertBusy(() -> { // IndicesClusterStateService#failAndRemoveShard() called asynchronously but we need it to have completed here.
|
||||
IndicesShardStoresResponse rsp = client().admin().indices().prepareShardStores(index).setShardStatuses("all").get();
|
||||
ImmutableOpenIntMap<List<IndicesShardStoresResponse.StoreStatus>> shardStatuses = rsp.getStoreStatuses().get(index);
|
||||
assertNotNull(shardStatuses);
|
||||
|
@ -205,6 +205,7 @@ public class IndicesShardStoreRequestIT extends ESIntegTestCase {
|
|||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
logger.info("--> enable allocation");
|
||||
enableAllocation(index);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue