EngineTestCase#getDocIds should use internal reader (#49564)

We do not guarantee that EngineTestCase#getDocIds is called after the 
engine has been externally refreshed. Hence, we trip an assertion
assertSearcherIsWarmedUp.

CI: https://gradle-enterprise.elastic.co/s/pm2at5qmfm2iu

Relates #48605
This commit is contained in:
Nhat Nguyen 2019-11-25 20:10:52 -05:00
parent 416178c7c8
commit d2e92a1791
1 changed files with 1 additions and 1 deletions

View File

@ -1011,7 +1011,7 @@ public abstract class EngineTestCase extends ESTestCase {
if (refresh) {
engine.refresh("test_get_doc_ids");
}
try (Engine.Searcher searcher = engine.acquireSearcher("test_get_doc_ids")) {
try (Engine.Searcher searcher = engine.acquireSearcher("test_get_doc_ids", Engine.SearcherScope.INTERNAL)) {
List<DocIdSeqNoAndSource> docs = new ArrayList<>();
for (LeafReaderContext leafContext : searcher.getIndexReader().leaves()) {
LeafReader reader = leafContext.reader();