|
8 | 8 |
|
9 | 9 | package org.opensearch.search.backpressure;
|
10 | 10 |
|
| 11 | +import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; |
| 12 | + |
11 | 13 | import org.opensearch.action.ActionRequest;
|
12 | 14 | import org.opensearch.action.ActionRequestValidationException;
|
13 | 15 | import org.opensearch.action.ActionType;
|
|
19 | 21 | import org.opensearch.common.inject.Inject;
|
20 | 22 | import org.opensearch.common.settings.Settings;
|
21 | 23 | import org.opensearch.common.unit.TimeValue;
|
| 24 | +import org.opensearch.common.util.FeatureFlags; |
22 | 25 | import org.opensearch.core.action.ActionListener;
|
23 | 26 | import org.opensearch.core.action.ActionResponse;
|
24 | 27 | import org.opensearch.core.common.io.stream.StreamInput;
|
|
34 | 37 | import org.opensearch.tasks.CancellableTask;
|
35 | 38 | import org.opensearch.tasks.Task;
|
36 | 39 | import org.opensearch.test.OpenSearchIntegTestCase;
|
| 40 | +import org.opensearch.test.ParameterizedOpenSearchIntegTestCase; |
37 | 41 | import org.opensearch.threadpool.ThreadPool;
|
38 | 42 | import org.opensearch.transport.TransportService;
|
39 | 43 | import org.hamcrest.MatcherAssert;
|
|
42 | 46 |
|
43 | 47 | import java.io.IOException;
|
44 | 48 | import java.util.ArrayList;
|
| 49 | +import java.util.Arrays; |
45 | 50 | import java.util.Collection;
|
46 | 51 | import java.util.Collections;
|
47 | 52 | import java.util.List;
|
|
50 | 55 | import java.util.concurrent.TimeUnit;
|
51 | 56 | import java.util.function.Supplier;
|
52 | 57 |
|
| 58 | +import static org.opensearch.search.SearchService.CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING; |
53 | 59 | import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked;
|
54 | 60 | import static org.hamcrest.Matchers.containsString;
|
55 | 61 | import static org.hamcrest.Matchers.instanceOf;
|
56 | 62 |
|
57 | 63 | @OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.SUITE)
|
58 |
| -public class SearchBackpressureIT extends OpenSearchIntegTestCase { |
| 64 | +public class SearchBackpressureIT extends ParameterizedOpenSearchIntegTestCase { |
59 | 65 |
|
60 | 66 | private static final TimeValue TIMEOUT = new TimeValue(10, TimeUnit.SECONDS);
|
61 | 67 | private static final int MOVING_AVERAGE_WINDOW_SIZE = 10;
|
62 | 68 |
|
| 69 | + public SearchBackpressureIT(Settings dynamicSettings) { |
| 70 | + super(dynamicSettings); |
| 71 | + } |
| 72 | + |
| 73 | + @ParametersFactory |
| 74 | + public static Collection<Object[]> parameters() { |
| 75 | + return Arrays.asList( |
| 76 | + new Object[] { Settings.builder().put(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING.getKey(), false).build() }, |
| 77 | + new Object[] { Settings.builder().put(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING.getKey(), true).build() } |
| 78 | + ); |
| 79 | + } |
| 80 | + |
| 81 | + @Override |
| 82 | + protected Settings featureFlagSettings() { |
| 83 | + return Settings.builder().put(super.featureFlagSettings()).put(FeatureFlags.CONCURRENT_SEGMENT_SEARCH, "true").build(); |
| 84 | + } |
| 85 | + |
63 | 86 | @Override
|
64 | 87 | protected Collection<Class<? extends Plugin>> nodePlugins() {
|
65 | 88 | final List<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
|
|
0 commit comments