|
@@ -352,8 +352,7 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/45801")
|
|
|
- public void testTranslogStats() {
|
|
|
+ public void testTranslogStats() throws Exception {
|
|
|
final String indexName = "test";
|
|
|
createIndex(indexName, Settings.builder()
|
|
|
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0)
|
|
@@ -375,16 +374,20 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- IndicesStatsResponse stats = client().admin().indices().prepareStats(indexName).clear().setTranslog(true).get();
|
|
|
- assertThat(stats.getIndex(indexName), notNullValue());
|
|
|
- assertThat(stats.getIndex(indexName).getPrimaries().getTranslog().estimatedNumberOfOperations(), equalTo(
|
|
|
- softDeletesEnabled ? uncommittedOps : nbDocs));
|
|
|
- assertThat(stats.getIndex(indexName).getPrimaries().getTranslog().getUncommittedOperations(), equalTo(uncommittedOps));
|
|
|
+ final int uncommittedTranslogOps = uncommittedOps;
|
|
|
+ assertBusy(() -> {
|
|
|
+ IndicesStatsResponse stats = client().admin().indices().prepareStats(indexName).clear().setTranslog(true).get();
|
|
|
+ assertThat(stats.getIndex(indexName), notNullValue());
|
|
|
+ assertThat(stats.getIndex(indexName).getPrimaries().getTranslog().estimatedNumberOfOperations(), equalTo(
|
|
|
+ softDeletesEnabled ? uncommittedTranslogOps : nbDocs));
|
|
|
+ assertThat(stats.getIndex(indexName).getPrimaries().getTranslog().getUncommittedOperations(), equalTo(uncommittedTranslogOps));
|
|
|
+ });
|
|
|
|
|
|
assertAcked(client().admin().indices().prepareClose("test"));
|
|
|
|
|
|
IndicesOptions indicesOptions = IndicesOptions.STRICT_EXPAND_OPEN;
|
|
|
- stats = client().admin().indices().prepareStats(indexName).setIndicesOptions(indicesOptions).clear().setTranslog(true).get();
|
|
|
+ IndicesStatsResponse stats = client().admin().indices().prepareStats(indexName).setIndicesOptions(indicesOptions)
|
|
|
+ .clear().setTranslog(true).get();
|
|
|
assertThat(stats.getIndex(indexName), notNullValue());
|
|
|
assertThat(stats.getIndex(indexName).getPrimaries().getTranslog().estimatedNumberOfOperations(),
|
|
|
equalTo(softDeletesEnabled ? 0 : nbDocs));
|