From dfcce2d8729591c29a079b2a309d9184cb0aa8ed Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Mon, 9 Apr 2018 16:35:47 +0200 Subject: [PATCH] Speed up some of our slowest unit tests. (#29414) `BaseRandomBinaryDocValuesRangeQueryTestCase.testRandomBig` should only run with nightly tests. It doesn't make sense to make it part of every test run. `UUIDTests` had a slow test for compression, which I made a bit faster by decreasing the number of indexed docs. --- .../BaseRandomBinaryDocValuesRangeQueryTestCase.java | 6 ------ .../src/test/java/org/elasticsearch/common/UUIDTests.java | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/server/src/test/java/org/apache/lucene/queries/BaseRandomBinaryDocValuesRangeQueryTestCase.java b/server/src/test/java/org/apache/lucene/queries/BaseRandomBinaryDocValuesRangeQueryTestCase.java index fcc9f67229f..dc21ed6a2f7 100644 --- a/server/src/test/java/org/apache/lucene/queries/BaseRandomBinaryDocValuesRangeQueryTestCase.java +++ b/server/src/test/java/org/apache/lucene/queries/BaseRandomBinaryDocValuesRangeQueryTestCase.java @@ -41,12 +41,6 @@ public abstract class BaseRandomBinaryDocValuesRangeQueryTestCase extends BaseRa // Can't test this how BaseRangeFieldQueryTestCase works now, because we're using BinaryDocValuesField here. } - @Override - public void testRandomBig() throws Exception { - // Test regardless whether -Dtests.nightly=true has been specified: - super.testRandomBig(); - } - @Override protected final Field newRangeField(Range box) { AbstractRange testRange = (AbstractRange) box; diff --git a/server/src/test/java/org/elasticsearch/common/UUIDTests.java b/server/src/test/java/org/elasticsearch/common/UUIDTests.java index 74a72dd6f30..849db0dc712 100644 --- a/server/src/test/java/org/elasticsearch/common/UUIDTests.java +++ b/server/src/test/java/org/elasticsearch/common/UUIDTests.java @@ -120,9 +120,9 @@ public class UUIDTests extends ESTestCase { Logger logger = Loggers.getLogger(UUIDTests.class); // Low number so that the test runs quickly, but the results are more interesting with larger numbers // of indexed documents - assertThat(testCompression(500000, 10000, 3, logger), Matchers.lessThan(12d)); // ~10.8 in practice - assertThat(testCompression(500000, 1000, 3, logger), Matchers.lessThan(14d)); // ~11.5 in practice - assertThat(testCompression(500000, 100, 3, logger), Matchers.lessThan(21d)); // ~19.5 in practice + assertThat(testCompression(100000, 10000, 3, logger), Matchers.lessThan(14d)); // ~12 in practice + assertThat(testCompression(100000, 1000, 3, logger), Matchers.lessThan(15d)); // ~13 in practice + assertThat(testCompression(100000, 100, 3, logger), Matchers.lessThan(21d)); // ~20 in practice } private static double testCompression(int numDocs, int numDocsPerSecond, int numNodes, Logger logger) throws Exception {