Use accurate total hits in IndexPrimaryRelocationIT

By default, we track total hits up to 10k but we might index more than
10k documents `testPrimaryRelocationWhileIndexing`. With this change, we
always request for the accurate total hits in the test.

> java.lang.AssertionError: Count is 10000+ hits but 11684 was expected.
This commit is contained in:
weizijun 2019-02-27 00:58:35 +08:00 committed by Yannick Welsch
parent 46ccfba808
commit 40348ab726
1 changed files with 2 additions and 2 deletions

View File

@ -100,8 +100,8 @@ public class IndexPrimaryRelocationIT extends ESIntegTestCase {
finished.set(true);
indexingThread.join();
refresh("test");
ElasticsearchAssertions.assertHitCount(client().prepareSearch("test").get(), numAutoGenDocs.get());
ElasticsearchAssertions.assertHitCount(client().prepareSearch("test")// extra paranoia ;)
ElasticsearchAssertions.assertHitCount(client().prepareSearch("test").setTrackTotalHits(true).get(), numAutoGenDocs.get());
ElasticsearchAssertions.assertHitCount(client().prepareSearch("test").setTrackTotalHits(true)// extra paranoia ;)
.setQuery(QueryBuilders.termQuery("auto", true)).get(), numAutoGenDocs.get());
}