Skip to content

Commit 940e0f1

Browse files
authored
Fix DataTiersUsageTransportActionTests testCalculateMAD (#64596)
Random the compression factor starting with 1 (to elimitinate nearly 0 values) which will only use one centroid (and yield 0 for MAD as the aproximate median is the same as the single centroid mean value)
1 parent c219e17 commit 940e0f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTiersUsageTransportActionTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
import static org.mockito.Mockito.when;
2727

2828
public class DataTiersUsageTransportActionTests extends ESTestCase {
29+
2930
public void testCalculateMAD() {
3031
assertThat(DataTiersUsageTransportAction.computeMedianAbsoluteDeviation(new TDigestState(10)), equalTo(0L));
3132

32-
TDigestState sketch = new TDigestState(randomDoubleBetween(0, 1000, false));
33+
TDigestState sketch = new TDigestState(randomDoubleBetween(1, 1000, false));
3334
sketch.add(1);
3435
sketch.add(1);
3536
sketch.add(2);

0 commit comments

Comments
 (0)