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:
David Turner 2017-12-01 13:33:23 +00:00 committed by GitHub
parent f123785d34
commit 5060007d20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 14 deletions

View File

@ -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);
}