Skip to content

Commit e3ed471

Browse files
committed
[TEST] speed up tests by reducing the recovery retry by default
1 parent eba2bd5 commit e3ed471

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/test/java/org/elasticsearch/test/InternalTestCluster.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
import java.util.concurrent.atomic.AtomicInteger;
117117

118118
import static com.carrotsearch.randomizedtesting.RandomizedTest.between;
119+
import static com.carrotsearch.randomizedtesting.RandomizedTest.frequently;
119120
import static com.carrotsearch.randomizedtesting.RandomizedTest.randomBoolean;
120121
import static junit.framework.Assert.fail;
121122
import static org.apache.lucene.util.LuceneTestCase.TEST_NIGHTLY;
@@ -304,12 +305,13 @@ public InternalTestCluster(long clusterSeed,
304305
builder.put(RecoverySettings.INDICES_RECOVERY_CONCURRENT_SMALL_FILE_STREAMS, RandomInts.randomIntBetween(random, 10, 15));
305306
builder.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_RECOVERIES, RandomInts.randomIntBetween(random, 5, 10));
306307
builder.put(RecoverySettings.INDICES_RECOVERY_RETRY_DELAY, TimeValue.timeValueMillis(RandomInts.randomIntBetween(random, 10, 25))); // more shared - we need to retry more often
307-
} else if (random.nextBoolean()) {
308+
} else if (frequently()) {
308309
builder.put(RecoverySettings.INDICES_RECOVERY_CONCURRENT_STREAMS, RandomInts.randomIntBetween(random, 3, 6));
309310
builder.put(RecoverySettings.INDICES_RECOVERY_CONCURRENT_SMALL_FILE_STREAMS, RandomInts.randomIntBetween(random, 3, 6));
310311
builder.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_RECOVERIES, RandomInts.randomIntBetween(random, 2, 5));
311-
builder.put(RecoverySettings.INDICES_RECOVERY_RETRY_DELAY, TimeValue.timeValueMillis(RandomInts.randomIntBetween(random, 20, 100)));
312312
}
313+
// always reduce this - it can make tests really slow
314+
builder.put(RecoverySettings.INDICES_RECOVERY_RETRY_DELAY, TimeValue.timeValueMillis(RandomInts.randomIntBetween(random, 20, 50)));
313315
defaultSettings = builder.build();
314316
executor = EsExecutors.newCached(0, TimeUnit.SECONDS, EsExecutors.daemonThreadFactory("test_" + clusterName));
315317
this.hasFilterCache = random.nextBoolean();

0 commit comments

Comments
 (0)