5656import static org .elasticsearch .test .hamcrest .ElasticsearchAssertions .assertAcked ;
5757import static org .elasticsearch .test .hamcrest .ElasticsearchAssertions .assertResponse ;
5858import static org .elasticsearch .xcontent .XContentFactory .jsonBuilder ;
59- import static org .elasticsearch .xpack .core .rollup .ConfigTestHelpers .randomInterval ;
6059import static org .hamcrest .Matchers .equalTo ;
6160
6261@ ESIntegTestCase .ClusterScope (scope = ESIntegTestCase .Scope .TEST , numDataNodes = 0 , numClientNodes = 4 )
@@ -87,7 +86,8 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
8786 return nodeSettings .build ();
8887 }
8988
90- public void setup (final String sourceIndex , int numOfShards , int numOfReplicas , long startTime ) throws IOException {
89+ public void setup (final String sourceIndex , int numOfShards , int numOfReplicas , long startTime , DownsampleConfig config )
90+ throws IOException {
9191 final Settings .Builder settings = indexSettings (numOfShards , numOfReplicas ).put (IndexSettings .MODE .getKey (), IndexMode .TIME_SERIES )
9292 .putList (IndexMetadata .INDEX_ROUTING_PATH .getKey (), List .of (FIELD_DIMENSION_KEYWORD ))
9393 .put (
@@ -123,10 +123,10 @@ public void setup(final String sourceIndex, int numOfShards, int numOfReplicas,
123123 Map .of (
124124 "downsample" ,
125125 new org .elasticsearch .xpack .core .ilm .DownsampleAction (
126- DateHistogramInterval . HOUR ,
126+ config . getFixedInterval () ,
127127 null ,
128128 randomBoolean (),
129- randomSamplingMethod ()
129+ config . getSamplingMethod ()
130130 )
131131 )
132132 )
@@ -145,9 +145,9 @@ public void testILMDownsampleRollingRestart() throws Exception {
145145
146146 final String sourceIndex = randomAlphaOfLength (10 ).toLowerCase (Locale .ROOT );
147147 long startTime = LocalDateTime .parse ("1993-09-09T18:00:00" ).atZone (ZoneId .of ("UTC" )).toInstant ().toEpochMilli ();
148- setup (sourceIndex , 1 , 0 , startTime );
149148 DownsampleConfig .SamplingMethod samplingMethod = randomSamplingMethod ();
150- final DownsampleConfig config = new DownsampleConfig (randomInterval (), samplingMethod );
149+ final DownsampleConfig config = new DownsampleConfig (DateHistogramInterval .HOUR , samplingMethod );
150+ setup (sourceIndex , 1 , 0 , startTime , config );
151151 final Supplier <XContentBuilder > sourceSupplier = () -> {
152152 final String ts = randomDateForInterval (config .getInterval (), startTime );
153153 double counterValue = DATE_FORMATTER .parseMillis (ts );
0 commit comments