Skip to content

Commit ee4e6b1

Browse files
Add TestLogging for #46701 (#46939) (#46949)
This at a very low rate and with the force merge in place before checking the cache size it's not clear why the cache is not of size `0` -> seems something else must be happening here that is unexpected. -> add debug logging to this test to find out Relates #46701
1 parent 875d864 commit ee4e6b1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
6363
import org.elasticsearch.test.ESIntegTestCase.Scope;
6464
import org.elasticsearch.test.InternalSettingsPlugin;
65+
import org.elasticsearch.test.junit.annotations.TestLogging;
6566

6667
import java.io.IOException;
6768
import java.util.ArrayList;
@@ -1007,6 +1008,7 @@ private void assertCumulativeQueryCacheStats(IndicesStatsResponse response) {
10071008
assertEquals(total, shardTotal);
10081009
}
10091010

1011+
@TestLogging(value = "_root:DEBUG", reason = "https://github.com/elastic/elasticsearch/issues/46701")
10101012
public void testFilterCacheStats() throws Exception {
10111013
Settings settings = Settings.builder().put(indexSettings())
10121014
.put("number_of_replicas", 0)
@@ -1064,11 +1066,14 @@ public void testFilterCacheStats() throws Exception {
10641066
});
10651067
flush("index");
10661068
}
1069+
logger.info("--> force merging to a single segment");
10671070
ForceMergeResponse forceMergeResponse =
10681071
client().admin().indices().prepareForceMerge("index").setFlush(true).setMaxNumSegments(1).get();
10691072
assertAllSuccessful(forceMergeResponse);
1073+
logger.info("--> refreshing");
10701074
refresh();
10711075

1076+
logger.info("--> verifying that cache size is 0");
10721077
response = client().admin().indices().prepareStats("index").setQueryCache(true).get();
10731078
assertCumulativeQueryCacheStats(response);
10741079
assertThat(response.getTotal().queryCache.getHitCount(), greaterThan(0L));

0 commit comments

Comments
 (0)