diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/SearchCancellationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/SearchCancellationIT.java index ba4f9249affd3..30f74d71099dd 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/SearchCancellationIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/SearchCancellationIT.java @@ -192,6 +192,12 @@ public void testCancellationDuringFetchPhase() throws Exception { public void testCancellationDuringAggregation() throws Exception { List 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");