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
This commit is contained in:
Armin Braun 2019-09-21 15:24:58 +02:00 committed by GitHub
parent 875d864be6
commit ee4e6b1382
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -62,6 +62,7 @@ import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.test.ESIntegTestCase.Scope;
import org.elasticsearch.test.InternalSettingsPlugin;
import org.elasticsearch.test.junit.annotations.TestLogging;
import java.io.IOException;
import java.util.ArrayList;
@ -1007,6 +1008,7 @@ public class IndexStatsIT extends ESIntegTestCase {
assertEquals(total, shardTotal);
}
@TestLogging(value = "_root:DEBUG", reason = "https://github.com/elastic/elasticsearch/issues/46701")
public void testFilterCacheStats() throws Exception {
Settings settings = Settings.builder().put(indexSettings())
.put("number_of_replicas", 0)
@ -1064,11 +1066,14 @@ public class IndexStatsIT extends ESIntegTestCase {
});
flush("index");
}
logger.info("--> force merging to a single segment");
ForceMergeResponse forceMergeResponse =
client().admin().indices().prepareForceMerge("index").setFlush(true).setMaxNumSegments(1).get();
assertAllSuccessful(forceMergeResponse);
logger.info("--> refreshing");
refresh();
logger.info("--> verifying that cache size is 0");
response = client().admin().indices().prepareStats("index").setQueryCache(true).get();
assertCumulativeQueryCacheStats(response);
assertThat(response.getTotal().queryCache.getHitCount(), greaterThan(0L));