88 */
99package org .elasticsearch .search .basic ;
1010
11+ import com .carrotsearch .randomizedtesting .annotations .Repeat ;
12+
1113import org .apache .lucene .tests .util .LuceneTestCase ;
1214import org .elasticsearch .action .ActionListener ;
1315import org .elasticsearch .action .bulk .BulkRequestBuilder ;
2022import org .elasticsearch .index .IndexModule ;
2123import org .elasticsearch .index .IndexSettings ;
2224import org .elasticsearch .index .query .MatchAllQueryBuilder ;
25+ import org .elasticsearch .test .ESIntegTestCase ;
2326import org .elasticsearch .test .disruption .NetworkDisruption ;
2427
2528import java .util .ArrayList ;
3134import static org .elasticsearch .test .hamcrest .ElasticsearchAssertions .assertAcked ;
3235
3336@ LuceneTestCase .SuppressFileSystems (value = "HandleLimitFS" ) // we sometimes have >2048 open files
37+ @ ESIntegTestCase .ClusterScope (scope = ESIntegTestCase .Scope .SUITE )
3438public class SearchWithRandomDisconnectsIT extends AbstractDisruptionTestCase {
3539
3640 public void testSearchWithRandomDisconnects () throws InterruptedException , ExecutionException {
@@ -82,14 +86,21 @@ private void runMoreSearches() {
8286 }
8387 });
8488 }
85- for (int i = 0 , n = randomIntBetween (50 , 100 ); i < n ; i ++) {
89+ for (int i = 0 , n = randomIntBetween (5 , 10 ); i < n ; i ++) {
8690 NetworkDisruption networkDisruption = new NetworkDisruption (
8791 isolateNode (internalCluster ().getRandomNodeName ()),
8892 NetworkDisruption .DISCONNECT
8993 );
9094 setDisruptionScheme (networkDisruption );
9195 networkDisruption .startDisrupting ();
9296 networkDisruption .stopDisrupting ();
97+
98+ try {
99+ Thread .sleep (300 );
100+ } catch (InterruptedException e ) {
101+ Thread .currentThread ().interrupt ();
102+ }
103+
93104 internalCluster ().clearDisruptionScheme ();
94105 ensureFullyConnectedCluster ();
95106 }
@@ -103,7 +114,7 @@ private void runMoreSearches() {
103114
104115 private static SearchRequestBuilder prepareRandomSearch () {
105116 return prepareSearch ("*" ).setQuery (new MatchAllQueryBuilder ())
106- .setSize (9999 )
117+ .setSize (randomIntBetween ( 10 , 100 ) )
107118 .setFetchSource (true )
108119 .setAllowPartialSearchResults (randomBoolean ());
109120 }
0 commit comments