Fix SliceBuilderTests#testRandom failures

Add missing shard context creation in a random test.
This commit is contained in:
Jim Ferenczi 2018-04-26 22:18:39 +02:00
parent 4cfca2fbd0
commit 80e0e64bfe
1 changed files with 1 additions and 0 deletions

View File

@ -423,6 +423,7 @@ public class SliceBuilderTests extends ESTestCase {
for (int i = 0; i < numSlices; i++) {
for (int j = 0; j < numShards; j++) {
SliceBuilder slice = new SliceBuilder("_id", i, numSlices);
context = createShardContext(Version.CURRENT, reader, "_id", DocValuesType.SORTED, numShards, j);
Query q = slice.toFilter(null, createRequest(j), context, Version.CURRENT);
if (i == j) {
assertThat(q, instanceOf(MatchAllDocsQuery.class));