Skip to content

Commit 10b272f

Browse files
committed
[TEST] speed up tests by reducing the recovery retry by default
1 parent fc7a77d commit 10b272f

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
@@ -106,6 +106,7 @@
106106
import java.util.concurrent.atomic.AtomicInteger;
107107

108108
import static com.carrotsearch.randomizedtesting.RandomizedTest.between;
109+
import static com.carrotsearch.randomizedtesting.RandomizedTest.frequently;
109110
import static com.carrotsearch.randomizedtesting.RandomizedTest.randomBoolean;
110111
import static junit.framework.Assert.fail;
111112
import static org.apache.lucene.util.LuceneTestCase.TEST_NIGHTLY;
@@ -293,12 +294,13 @@ public InternalTestCluster(long clusterSeed,
293294
builder.put(RecoverySettings.INDICES_RECOVERY_CONCURRENT_SMALL_FILE_STREAMS, RandomInts.randomIntBetween(random, 10, 15));
294295
builder.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_RECOVERIES, RandomInts.randomIntBetween(random, 5, 10));
295296
builder.put(RecoverySettings.INDICES_RECOVERY_RETRY_DELAY, TimeValue.timeValueMillis(RandomInts.randomIntBetween(random, 10, 25))); // more shared - we need to retry more often
296-
} else if (random.nextBoolean()) {
297+
} else if (frequently()) {
297298
builder.put(RecoverySettings.INDICES_RECOVERY_CONCURRENT_STREAMS, RandomInts.randomIntBetween(random, 3, 6));
298299
builder.put(RecoverySettings.INDICES_RECOVERY_CONCURRENT_SMALL_FILE_STREAMS, RandomInts.randomIntBetween(random, 3, 6));
299300
builder.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_RECOVERIES, RandomInts.randomIntBetween(random, 2, 5));
300-
builder.put(RecoverySettings.INDICES_RECOVERY_RETRY_DELAY, TimeValue.timeValueMillis(RandomInts.randomIntBetween(random, 20, 100)));
301301
}
302+
// always reduce this - it can make tests really slow
303+
builder.put(RecoverySettings.INDICES_RECOVERY_RETRY_DELAY, TimeValue.timeValueMillis(RandomInts.randomIntBetween(random, 20, 50)));
302304
defaultSettings = builder.build();
303305
executor = EsExecutors.newCached(0, TimeUnit.SECONDS, EsExecutors.daemonThreadFactory("test_" + clusterName));
304306
this.hasFilterCache = random.nextBoolean();

0 commit comments

Comments
 (0)