diff --git a/core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedStreamTests.java b/core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedStreamTests.java index 62ea9b6070a..b5800f34411 100644 --- a/core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedStreamTests.java +++ b/core/src/test/java/org/elasticsearch/common/compress/AbstractCompressedStreamTests.java @@ -48,7 +48,7 @@ public abstract class AbstractCompressedStreamTests extends ESTestCase { public void testRandom() throws IOException { Random r = getRandom(); for (int i = 0; i < 10; i++) { - byte bytes[] = new byte[TestUtil.nextInt(r, 1, 400000)]; + byte bytes[] = new byte[TestUtil.nextInt(r, 1, 100000)]; r.nextBytes(bytes); doTest(bytes); } @@ -56,7 +56,7 @@ public abstract class AbstractCompressedStreamTests extends ESTestCase { public void testRandomThreads() throws Exception { final Random r = getRandom(); - int threadCount = TestUtil.nextInt(r, 2, 10); + int threadCount = TestUtil.nextInt(r, 2, 6); Thread[] threads = new Thread[threadCount]; final CountDownLatch startingGun = new CountDownLatch(1); for (int tid=0; tid < threadCount; tid++) { @@ -102,7 +102,7 @@ public abstract class AbstractCompressedStreamTests extends ESTestCase { public void testLineDocsThreads() throws Exception { final Random r = getRandom(); - int threadCount = TestUtil.nextInt(r, 2, 10); + int threadCount = TestUtil.nextInt(r, 2, 6); Thread[] threads = new Thread[threadCount]; final CountDownLatch startingGun = new CountDownLatch(1); for (int tid=0; tid < threadCount; tid++) { @@ -162,7 +162,7 @@ public abstract class AbstractCompressedStreamTests extends ESTestCase { public void testRepetitionsLThreads() throws Exception { final Random r = getRandom(); - int threadCount = TestUtil.nextInt(r, 2, 10); + int threadCount = TestUtil.nextInt(r, 2, 6); Thread[] threads = new Thread[threadCount]; final CountDownLatch startingGun = new CountDownLatch(1); for (int tid=0; tid < threadCount; tid++) { @@ -226,7 +226,7 @@ public abstract class AbstractCompressedStreamTests extends ESTestCase { public void testRepetitionsIThreads() throws Exception { final Random r = getRandom(); - int threadCount = TestUtil.nextInt(r, 2, 10); + int threadCount = TestUtil.nextInt(r, 2, 6); Thread[] threads = new Thread[threadCount]; final CountDownLatch startingGun = new CountDownLatch(1); for (int tid=0; tid < threadCount; tid++) { @@ -350,7 +350,7 @@ public abstract class AbstractCompressedStreamTests extends ESTestCase { public void testRepetitionsSThreads() throws Exception { final Random r = getRandom(); - int threadCount = TestUtil.nextInt(r, 2, 10); + int threadCount = TestUtil.nextInt(r, 2, 6); Thread[] threads = new Thread[threadCount]; final CountDownLatch startingGun = new CountDownLatch(1); for (int tid=0; tid < threadCount; tid++) { diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/AbstractStringFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/AbstractStringFieldDataTests.java index 4d19f92097d..8fcc949936b 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/AbstractStringFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/AbstractStringFieldDataTests.java @@ -250,7 +250,7 @@ public abstract class AbstractStringFieldDataTests extends AbstractFieldDataImpl for (int i = 1; i < values.length; ++i) { values[i] = TestUtil.randomUnicodeString(getRandom()); } - final int numDocs = scaledRandomIntBetween(10, 10000); + final int numDocs = scaledRandomIntBetween(10, 3072); for (int i = 0; i < numDocs; ++i) { final String value = RandomPicks.randomFrom(getRandom(), values); if (value == null) { @@ -306,7 +306,7 @@ public abstract class AbstractStringFieldDataTests extends AbstractFieldDataImpl for (int i = 1; i < values.length; ++i) { values[i] = TestUtil.randomUnicodeString(getRandom()); } - final int numDocs = scaledRandomIntBetween(10, 10000); + final int numDocs = scaledRandomIntBetween(10, 3072); for (int i = 0; i < numDocs; ++i) { final String value = RandomPicks.randomFrom(getRandom(), values); if (value == null) { @@ -359,7 +359,7 @@ public abstract class AbstractStringFieldDataTests extends AbstractFieldDataImpl for (int i = 0; i < values.length; ++i) { values[i] = TestUtil.randomSimpleString(getRandom()); } - final int numParents = scaledRandomIntBetween(10, 10000); + final int numParents = scaledRandomIntBetween(10, 3072); List docs = new ArrayList<>(); FixedBitSet parents = new FixedBitSet(64); for (int i = 0; i < numParents; ++i) { diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/DuelFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/DuelFieldDataTests.java index 44147a2c362..3dee75021dc 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/DuelFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/DuelFieldDataTests.java @@ -66,7 +66,7 @@ public class DuelFieldDataTests extends AbstractFieldDataTests { .endObject().endObject().endObject().string(); final DocumentMapper mapper = mapperService.documentMapperParser().parse(mapping); Random random = getRandom(); - int atLeast = scaledRandomIntBetween(1000, 1500); + int atLeast = scaledRandomIntBetween(200, 1500); for (int i = 0; i < atLeast; i++) { String s = Integer.toString(randomByte()); @@ -142,8 +142,8 @@ public class DuelFieldDataTests extends AbstractFieldDataTests { final DocumentMapper mapper = mapperService.documentMapperParser().parse(mapping); Random random = getRandom(); - int atLeast = scaledRandomIntBetween(1000, 1500); - final int maxNumValues = randomBoolean() ? 1 : randomIntBetween(2, 40); + int atLeast = scaledRandomIntBetween(200, 1500); + final int maxNumValues = randomBoolean() ? 1 : randomIntBetween(2, 10); byte[] values = new byte[maxNumValues]; for (int i = 0; i < atLeast; i++) { int numValues = randomInt(maxNumValues); @@ -224,8 +224,8 @@ public class DuelFieldDataTests extends AbstractFieldDataTests { final DocumentMapper mapper = mapperService.documentMapperParser().parse(mapping); Random random = getRandom(); - int atLeast = scaledRandomIntBetween(1000, 1500); - final int maxNumValues = randomBoolean() ? 1 : randomIntBetween(2, 40); + int atLeast = scaledRandomIntBetween(200, 1500); + final int maxNumValues = randomBoolean() ? 1 : randomIntBetween(2, 10); float[] values = new float[maxNumValues]; for (int i = 0; i < atLeast; i++) { int numValues = randomInt(maxNumValues); @@ -301,7 +301,7 @@ public class DuelFieldDataTests extends AbstractFieldDataTests { @Test public void testDuelStrings() throws Exception { Random random = getRandom(); - int atLeast = scaledRandomIntBetween(1000, 1500); + int atLeast = scaledRandomIntBetween(200, 1500); for (int i = 0; i < atLeast; i++) { Document d = new Document(); d.add(new StringField("_id", "" + i, Field.Store.NO)); @@ -407,8 +407,8 @@ public class DuelFieldDataTests extends AbstractFieldDataTests { final DocumentMapper mapper = mapperService.documentMapperParser().parse(mapping); Random random = getRandom(); - int atLeast = scaledRandomIntBetween(1000, 1500); - int maxValuesPerDoc = randomBoolean() ? 1 : randomIntBetween(2, 40); + int atLeast = scaledRandomIntBetween(200, 1500); + int maxValuesPerDoc = randomBoolean() ? 1 : randomIntBetween(2, 10); // to test deduplication double defaultLat = randomDouble() * 180 - 90; double defaultLon = randomDouble() * 360 - 180;