diff --git a/pom.xml b/pom.xml
index 95066d84d93..fb585c2a96b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,7 +48,7 @@
com.carrotsearch.randomizedtesting
randomizedtesting-runner
- 2.0.15
+ 2.1.1
test
@@ -356,7 +356,7 @@
com.carrotsearch.randomizedtesting
junit4-maven-plugin
- 2.0.15
+ 2.1.1
tests
diff --git a/src/test/java/org/apache/lucene/queries/BlendedTermQueryTest.java b/src/test/java/org/apache/lucene/queries/BlendedTermQueryTest.java
index e6f262d055c..23664c36182 100644
--- a/src/test/java/org/apache/lucene/queries/BlendedTermQueryTest.java
+++ b/src/test/java/org/apache/lucene/queries/BlendedTermQueryTest.java
@@ -63,7 +63,7 @@ public class BlendedTermQueryTest extends ElasticsearchLuceneTestCase {
d.add(new TextField("surname", surNames[i], Field.Store.NO));
w.addDocument(d);
}
- int iters = atLeast(25);
+ int iters = scaledRandomIntBetween(25, 100);
for (int j = 0; j < iters; j++) {
Document d = new Document();
d.add(new TextField("id", Integer.toString(firstNames.length + j), Field.Store.YES));
@@ -123,7 +123,7 @@ public class BlendedTermQueryTest extends ElasticsearchLuceneTestCase {
d.add(new Field("song", song[i], ft));
w.addDocument(d);
}
- int iters = atLeast(25);
+ int iters = scaledRandomIntBetween(25, 100);
for (int j = 0; j < iters; j++) {
Document d = new Document();
d.add(new TextField("id", Integer.toString(username.length + j), Field.Store.YES));
@@ -171,7 +171,7 @@ public class BlendedTermQueryTest extends ElasticsearchLuceneTestCase {
@Test
public void testBasics() {
- final int iters = atLeast(5);
+ final int iters = scaledRandomIntBetween(5, 25);
for (int j = 0; j < iters; j++) {
String[] fields = new String[1 + random().nextInt(10)];
for (int i = 0; i < fields.length; i++) {
@@ -210,7 +210,7 @@ public class BlendedTermQueryTest extends ElasticsearchLuceneTestCase {
@Test
public void testExtractTerms() {
Set terms = new HashSet();
- int num = atLeast(1);
+ int num = scaledRandomIntBetween(1, 10);
for (int i = 0; i < num; i++) {
terms.add(new Term(_TestUtil.randomRealisticUnicodeString(random(), 1, 10), _TestUtil.randomRealisticUnicodeString(random(), 1, 10)));
}
diff --git a/src/test/java/org/apache/lucene/search/postingshighlight/CustomPostingsHighlighterTests.java b/src/test/java/org/apache/lucene/search/postingshighlight/CustomPostingsHighlighterTests.java
index d33ece139ff..9bd0eedece4 100644
--- a/src/test/java/org/apache/lucene/search/postingshighlight/CustomPostingsHighlighterTests.java
+++ b/src/test/java/org/apache/lucene/search/postingshighlight/CustomPostingsHighlighterTests.java
@@ -451,7 +451,7 @@ public class CustomPostingsHighlighterTests extends ElasticsearchLuceneTestCase
Snippet[] snippets = highlighter.highlightDoc("body", filteredQueryTerms, searcher, docId, 5);
assertThat(snippets.length, equalTo(0));
- highlighter = new CustomPostingsHighlighter(passageFormatter, values, true, Integer.MAX_VALUE - 1, atLeast(1));
+ highlighter = new CustomPostingsHighlighter(passageFormatter, values, true, Integer.MAX_VALUE - 1, scaledRandomIntBetween(1, 10));
snippets = highlighter.highlightDoc("body", filteredQueryTerms, searcher, docId, 5);
assertThat(snippets.length, equalTo(1));
assertThat(snippets[0].getText(), equalTo("This is a test."));
diff --git a/src/test/java/org/apache/lucene/search/postingshighlight/XPostingsHighlighterTests.java b/src/test/java/org/apache/lucene/search/postingshighlight/XPostingsHighlighterTests.java
index 6f63b72aa57..df11d5ed87f 100644
--- a/src/test/java/org/apache/lucene/search/postingshighlight/XPostingsHighlighterTests.java
+++ b/src/test/java/org/apache/lucene/search/postingshighlight/XPostingsHighlighterTests.java
@@ -1484,7 +1484,7 @@ public class XPostingsHighlighterTests extends ElasticsearchLuceneTestCase {
FieldType offsetsType = new FieldType(TextField.TYPE_STORED);
offsetsType.setIndexOptions(FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS);
- int numDocs = atLeast(100);
+ int numDocs = scaledRandomIntBetween(100, 1000);
for(int i=0;i nodes = new ArrayList();
int nodeIdx = 0;
- int iters = atLeast(10);
+ int iters = scaledRandomIntBetween(10, 100);
for (int i = 0; i < iters; i++) {
DiscoveryNodes.Builder nodesBuilder = DiscoveryNodes.builder();
int numNodes = between(1, 20);
diff --git a/src/test/java/org/elasticsearch/cluster/routing/allocation/RandomAllocationDeciderTests.java b/src/test/java/org/elasticsearch/cluster/routing/allocation/RandomAllocationDeciderTests.java
index 5cbd22dd9b3..5ffe1e860c9 100644
--- a/src/test/java/org/elasticsearch/cluster/routing/allocation/RandomAllocationDeciderTests.java
+++ b/src/test/java/org/elasticsearch/cluster/routing/allocation/RandomAllocationDeciderTests.java
@@ -80,7 +80,7 @@ public class RandomAllocationDeciderTests extends ElasticsearchAllocationTestCas
RoutingTable routingTable = routingTableBuilder.build();
ClusterState clusterState = ClusterState.builder().metaData(metaData).routingTable(routingTable).build();
- int numIters = atLeast(20);
+ int numIters = scaledRandomIntBetween(20, 100);;
int nodeIdCounter = 0;
int atMostNodes = between(Math.max(1, maxNumReplicas), numIters);
final boolean frequentNodes = randomBoolean();
@@ -90,7 +90,7 @@ public class RandomAllocationDeciderTests extends ElasticsearchAllocationTestCas
if (clusterState.nodes().size() <= atMostNodes &&
(nodeIdCounter == 0 || (frequentNodes ? frequently() : rarely()))) {
- int numNodes = atLeast(1);
+ int numNodes = scaledRandomIntBetween(1, 15);
for (int j = 0; j < numNodes; j++) {
logger.info("adding node [{}]", nodeIdCounter);
newNodesBuilder.put(newNode("NODE_" + (nodeIdCounter++)));
diff --git a/src/test/java/org/elasticsearch/common/hashing/MurmurHash3Tests.java b/src/test/java/org/elasticsearch/common/hashing/MurmurHash3Tests.java
index a6e048bcf4a..6d3f5c8d05b 100644
--- a/src/test/java/org/elasticsearch/common/hashing/MurmurHash3Tests.java
+++ b/src/test/java/org/elasticsearch/common/hashing/MurmurHash3Tests.java
@@ -31,14 +31,14 @@ import java.nio.LongBuffer;
public class MurmurHash3Tests extends ElasticsearchTestCase {
public void testHash128() {
- final int iters = atLeast(100);
+ final int iters = scaledRandomIntBetween(100, 5000);
for (int i = 0; i < iters; ++i) {
final int seed = randomInt();
final int offset = randomInt(20);
final int len = randomInt(randomBoolean() ? 20 : 200);
final byte[] bytes = new byte[len + offset + randomInt(3)];
getRandom().nextBytes(bytes);
- HashCode h1 = Hashing.murmur3_128(seed).hashBytes(bytes, offset, len);;
+ HashCode h1 = Hashing.murmur3_128(seed).hashBytes(bytes, offset, len);
MurmurHash3.Hash128 h2 = MurmurHash3.hash128(bytes, offset, len, seed, new MurmurHash3.Hash128());
assertEquals(h1, h2);
}
diff --git a/src/test/java/org/elasticsearch/common/lucene/search/XBooleanFilterTests.java b/src/test/java/org/elasticsearch/common/lucene/search/XBooleanFilterTests.java
index 32c08afbab1..e3f9d16eab3 100644
--- a/src/test/java/org/elasticsearch/common/lucene/search/XBooleanFilterTests.java
+++ b/src/test/java/org/elasticsearch/common/lucene/search/XBooleanFilterTests.java
@@ -434,7 +434,7 @@ public class XBooleanFilterTests extends ElasticsearchLuceneTestCase {
@Test
public void testRandom() throws IOException {
- int iterations = atLeast(400); // don't worry that is fast!
+ int iterations = scaledRandomIntBetween(100, 1000); // don't worry that is fast!
for (int iter = 0; iter < iterations; iter++) {
int numClauses = 1 + random().nextInt(10);
FilterClause[] clauses = new FilterClause[numClauses];
diff --git a/src/test/java/org/elasticsearch/common/unit/FuzzinessTests.java b/src/test/java/org/elasticsearch/common/unit/FuzzinessTests.java
index 448d0522efb..889b2ddfc09 100644
--- a/src/test/java/org/elasticsearch/common/unit/FuzzinessTests.java
+++ b/src/test/java/org/elasticsearch/common/unit/FuzzinessTests.java
@@ -45,7 +45,7 @@ public class FuzzinessTests extends ElasticsearchTestCase {
@Test
public void testParseFromXContent() throws IOException {
- final int iters = atLeast(10);
+ final int iters = randomIntBetween(10, 50);
for (int i = 0; i < iters; i++) {
{
XContent xcontent = XContentType.JSON.xContent();
@@ -165,7 +165,7 @@ public class FuzzinessTests extends ElasticsearchTestCase {
@Test
public void testAsDistance() {
- final int iters = atLeast(10);
+ final int iters = randomIntBetween(10, 50);
for (int i = 0; i < iters; i++) {
Integer integer = Integer.valueOf(randomIntBetween(0, 10));
String value = "" + (randomBoolean() ? integer.intValue() : integer.floatValue());
@@ -183,7 +183,7 @@ public class FuzzinessTests extends ElasticsearchTestCase {
assertThat((double) Fuzziness.TWO.asSimilarity("abcefg"), closeTo(0.66f, 0.05));
assertThat((double) Fuzziness.ONE.asSimilarity("ab"), closeTo(0.5f, 0.05));
- int iters = atLeast(100);
+ int iters = randomIntBetween(100, 1000);
for (int i = 0; i < iters; i++) {
Fuzziness fuzziness = Fuzziness.fromEdits(between(1, 2));
String string = rarely() ? randomRealisticUnicodeOfLengthBetween(2, 4) :
diff --git a/src/test/java/org/elasticsearch/common/util/ByteUtilsTests.java b/src/test/java/org/elasticsearch/common/util/ByteUtilsTests.java
index 73319623fd4..729033bdd6f 100644
--- a/src/test/java/org/elasticsearch/common/util/ByteUtilsTests.java
+++ b/src/test/java/org/elasticsearch/common/util/ByteUtilsTests.java
@@ -45,7 +45,7 @@ public class ByteUtilsTests extends ElasticsearchTestCase {
}
public void testFloat() throws IOException {
- final float[] data = new float[atLeast(1000)];
+ final float[] data = new float[scaledRandomIntBetween(1000, 10000)];
final byte[] encoded = new byte[data.length * 4];
for (int i = 0; i < data.length; ++i) {
data[i] = randomFloat();
@@ -57,7 +57,7 @@ public class ByteUtilsTests extends ElasticsearchTestCase {
}
public void testDouble() throws IOException {
- final double[] data = new double[atLeast(1000)];
+ final double[] data = new double[scaledRandomIntBetween(1000, 10000)];
final byte[] encoded = new byte[data.length * 8];
for (int i = 0; i < data.length; ++i) {
data[i] = randomDouble();
@@ -69,7 +69,7 @@ public class ByteUtilsTests extends ElasticsearchTestCase {
}
public void testVLong() throws IOException {
- final long[] data = new long[atLeast(1000)];
+ final long[] data = new long[scaledRandomIntBetween(1000, 10000)];
for (int i = 0; i < data.length; ++i) {
switch (randomInt(4)) {
case 0:
diff --git a/src/test/java/org/elasticsearch/common/util/BytesRefHashTests.java b/src/test/java/org/elasticsearch/common/util/BytesRefHashTests.java
index 91e933fe2cd..8d03dd4c7ae 100644
--- a/src/test/java/org/elasticsearch/common/util/BytesRefHashTests.java
+++ b/src/test/java/org/elasticsearch/common/util/BytesRefHashTests.java
@@ -94,7 +94,7 @@ public class BytesRefHashTests extends ElasticsearchTestCase {
@Test
public void testSize() {
BytesRef ref = new BytesRef();
- int num = atLeast(2);
+ int num = scaledRandomIntBetween(2, 20);
for (int j = 0; j < num; j++) {
final int mod = 1+randomInt(40);
for (int i = 0; i < 797; i++) {
@@ -126,7 +126,7 @@ public class BytesRefHashTests extends ElasticsearchTestCase {
public void testGet() {
BytesRef ref = new BytesRef();
BytesRef scratch = new BytesRef();
- int num = atLeast(2);
+ int num = scaledRandomIntBetween(2, 20);
for (int j = 0; j < num; j++) {
Map strings = new HashMap();
int uniqueCount = 0;
@@ -166,7 +166,7 @@ public class BytesRefHashTests extends ElasticsearchTestCase {
public void testAdd() {
BytesRef ref = new BytesRef();
BytesRef scratch = new BytesRef();
- int num = atLeast(2);
+ int num = scaledRandomIntBetween(2, 20);
for (int j = 0; j < num; j++) {
Set strings = new HashSet();
int uniqueCount = 0;
@@ -202,7 +202,7 @@ public class BytesRefHashTests extends ElasticsearchTestCase {
public void testFind() throws Exception {
BytesRef ref = new BytesRef();
BytesRef scratch = new BytesRef();
- int num = atLeast(2);
+ int num = scaledRandomIntBetween(2, 20);
for (int j = 0; j < num; j++) {
Set strings = new HashSet();
int uniqueCount = 0;
diff --git a/src/test/java/org/elasticsearch/common/util/DoubleObjectHashMapTests.java b/src/test/java/org/elasticsearch/common/util/DoubleObjectHashMapTests.java
index a7a6b7d64d6..fbde00a9bf7 100644
--- a/src/test/java/org/elasticsearch/common/util/DoubleObjectHashMapTests.java
+++ b/src/test/java/org/elasticsearch/common/util/DoubleObjectHashMapTests.java
@@ -30,7 +30,7 @@ public class DoubleObjectHashMapTests extends ElasticsearchTestCase {
final DoubleObjectOpenHashMap