|
62 | 62 | import org.elasticsearch.test.ESIntegTestCase.ClusterScope; |
63 | 63 | import org.elasticsearch.test.ESIntegTestCase.Scope; |
64 | 64 | import org.elasticsearch.test.InternalSettingsPlugin; |
| 65 | +import org.elasticsearch.test.junit.annotations.TestLogging; |
65 | 66 |
|
66 | 67 | import java.io.IOException; |
67 | 68 | import java.util.ArrayList; |
@@ -1007,6 +1008,7 @@ private void assertCumulativeQueryCacheStats(IndicesStatsResponse response) { |
1007 | 1008 | assertEquals(total, shardTotal); |
1008 | 1009 | } |
1009 | 1010 |
|
| 1011 | + @TestLogging(value = "_root:DEBUG", reason = "https://github.com/elastic/elasticsearch/issues/46701") |
1010 | 1012 | public void testFilterCacheStats() throws Exception { |
1011 | 1013 | Settings settings = Settings.builder().put(indexSettings()) |
1012 | 1014 | .put("number_of_replicas", 0) |
@@ -1064,11 +1066,14 @@ public void testFilterCacheStats() throws Exception { |
1064 | 1066 | }); |
1065 | 1067 | flush("index"); |
1066 | 1068 | } |
| 1069 | + logger.info("--> force merging to a single segment"); |
1067 | 1070 | ForceMergeResponse forceMergeResponse = |
1068 | 1071 | client().admin().indices().prepareForceMerge("index").setFlush(true).setMaxNumSegments(1).get(); |
1069 | 1072 | assertAllSuccessful(forceMergeResponse); |
| 1073 | + logger.info("--> refreshing"); |
1070 | 1074 | refresh(); |
1071 | 1075 |
|
| 1076 | + logger.info("--> verifying that cache size is 0"); |
1072 | 1077 | response = client().admin().indices().prepareStats("index").setQueryCache(true).get(); |
1073 | 1078 | assertCumulativeQueryCacheStats(response); |
1074 | 1079 | assertThat(response.getTotal().queryCache.getHitCount(), greaterThan(0L)); |
|
0 commit comments