From 0230ecbeac45b9b7fb7b118b4d26c7656633e8f0 Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Mon, 3 Mar 2014 20:31:38 +0100 Subject: [PATCH] Fix test bug: a too low compression level can make accuracy terrible. --- .../search/aggregations/metrics/PercentilesTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/elasticsearch/search/aggregations/metrics/PercentilesTests.java b/src/test/java/org/elasticsearch/search/aggregations/metrics/PercentilesTests.java index 016f657f8aa..4c85659b0da 100644 --- a/src/test/java/org/elasticsearch/search/aggregations/metrics/PercentilesTests.java +++ b/src/test/java/org/elasticsearch/search/aggregations/metrics/PercentilesTests.java @@ -23,10 +23,10 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; import org.elasticsearch.search.aggregations.bucket.histogram.Histogram.Order; -import org.elasticsearch.search.aggregations.metrics.percentiles.PercentilesBuilder; import org.elasticsearch.search.aggregations.metrics.percentiles.Percentiles; import org.elasticsearch.search.aggregations.metrics.percentiles.Percentiles.Estimator.TDigest; import org.elasticsearch.search.aggregations.metrics.percentiles.Percentiles.Percentile; +import org.elasticsearch.search.aggregations.metrics.percentiles.PercentilesBuilder; import org.junit.Test; import java.util.Arrays; @@ -66,7 +66,7 @@ public class PercentilesTests extends AbstractNumericTests { private static PercentilesBuilder randomEstimator(PercentilesBuilder builder) { if (randomBoolean()) { TDigest estimator = TDigest.tDigest(); - estimator.compression(randomDouble() * 100); + estimator.compression(randomIntBetween(20, 120) + randomDouble()); builder.estimator(estimator); } return builder;