Skip to content

Commit 7cebd35

Browse files
committed
Fix IndexStatsIT#testFilterCacheStats
Verify that the global checkpoint actually got synced with the in-memory version in an `assertBusy` block. Resolve #124447
1 parent 235867c commit 7cebd35

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

server/src/internalClusterTest/java/org/elasticsearch/indices/stats/IndexStatsIT.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
5959
import org.elasticsearch.test.ESIntegTestCase.Scope;
6060
import org.elasticsearch.test.InternalSettingsPlugin;
61-
import org.elasticsearch.test.junit.annotations.TestLogging;
6261
import org.elasticsearch.xcontent.XContentType;
6362

6463
import java.io.IOException;
@@ -1095,7 +1094,6 @@ private void assertCumulativeQueryCacheStats(IndicesStatsResponse response) {
10951094
assertEquals(total, shardTotal);
10961095
}
10971096

1098-
@TestLogging(value = "org.elasticsearch.cluster.service:TRACE", reason = "https://github.com/elastic/elasticsearch/issues/124447")
10991097
public void testFilterCacheStats() throws Exception {
11001098
Settings settings = Settings.builder()
11011099
.put(indexSettings())
@@ -1370,10 +1368,12 @@ private void persistGlobalCheckpoint(String index) throws Exception {
13701368
for (IndexService indexService : indexServices) {
13711369
for (IndexShard indexShard : indexService) {
13721370
indexShard.sync();
1373-
assertThat(
1374-
"Routing entry for shard " + indexShard.routingEntry().toString(),
1375-
indexShard.getLastSyncedGlobalCheckpoint(),
1376-
equalTo(indexShard.getLastKnownGlobalCheckpoint())
1371+
assertBusy(
1372+
() -> assertThat(
1373+
"Routing entry for shard " + indexShard.routingEntry().toString(),
1374+
indexShard.getLastSyncedGlobalCheckpoint(),
1375+
equalTo(indexShard.getLastKnownGlobalCheckpoint())
1376+
)
13771377
);
13781378
}
13791379
}

0 commit comments

Comments
 (0)