Skip to content

Commit

Permalink
Fixes testCancellationDuringAggregation test
Browse files Browse the repository at this point in the history
The SearchCancellationIT#testCancellationDuringAggregation only works when
real reduce takes place and therefore needs at least 2 shards to be present.

Relates to elastic#71021
  • Loading branch information
imotov committed Oct 2, 2021
1 parent a9e0577 commit 8b03763
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ public void testCancellationDuringFetchPhase() throws Exception {

public void testCancellationDuringAggregation() throws Exception {
List<ScriptedBlockPlugin> plugins = initBlockFactory();
// This test is only meaningful with at least 2 shards to trigger reduce
int numberOfShards = between(2, 5);
createIndex("test", Settings.builder()
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, numberOfShards)
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
.build());
indexTestData();

logger.info("Executing search");
Expand Down

0 comments on commit 8b03763

Please sign in to comment.