@@ -420,15 +420,16 @@ public void testILMWaitsForTimeSeriesEndTimeToLapse() throws Exception {
420420 rolloverMaxOneDocCondition (client (), dataStream );
421421
422422 assertBusy (() -> {
423+ Map <String , Object > explainResponse = explainIndex (client (), backingIndexName );
423424 assertThat (
424425 "index must wait in the " + WaitUntilTimeSeriesEndTimePassesStep .NAME + " until its end time lapses" ,
425- explainIndex ( client (), backingIndexName ) .get ("step" ),
426+ explainResponse .get ("step" ),
426427 is (WaitUntilTimeSeriesEndTimePassesStep .NAME )
427428 );
428429
429- assertThat (explainIndex ( client (), backingIndexName ) .get ("step_info" ), is (notNullValue ()));
430+ assertThat (explainResponse .get ("step_info" ), is (notNullValue ()));
430431 assertThat (
431- (String ) ((Map <String , Object >) explainIndex ( client (), backingIndexName ) .get ("step_info" )).get ("message" ),
432+ (String ) ((Map <String , Object >) explainResponse .get ("step_info" )).get ("message" ),
432433 containsString ("Waiting until the index's time series end time lapses" )
433434 );
434435 }, 30 , TimeUnit .SECONDS );
@@ -630,8 +631,9 @@ public void testDownsampleTwiceSameInterval() throws Exception {
630631 assertThat (indexExists (downsampleIndexName ), is (true ));
631632 assertThat (indexExists (firstBackingIndex ), is (false ));
632633
633- assertThat (explainIndex (client (), downsampleIndexName ).get ("step" ), is (PhaseCompleteStep .NAME ));
634- assertThat (explainIndex (client (), downsampleIndexName ).get ("phase" ), is ("warm" ));
634+ Map <String , Object > explainResponse = explainIndex (client (), downsampleIndexName );
635+ assertThat (explainResponse .get ("step" ), is (PhaseCompleteStep .NAME ));
636+ assertThat (explainResponse .get ("phase" ), is ("warm" ));
635637
636638 Map <String , Object > settings = getOnlyIndexSettings (client (), downsampleIndexName );
637639 assertEquals (firstBackingIndex , settings .get (IndexMetadata .INDEX_DOWNSAMPLE_ORIGIN_NAME .getKey ()));
@@ -674,8 +676,9 @@ public void testDownsampleTwiceSameInterval() throws Exception {
674676 // reach the cold/complete/complete step
675677 assertBusy (() -> {
676678 assertThat (indexExists (downsampleIndexName ), is (true ));
677- assertThat (explainIndex (client (), downsampleIndexName ).get ("step" ), is (PhaseCompleteStep .NAME ));
678- assertThat (explainIndex (client (), downsampleIndexName ).get ("phase" ), is ("cold" ));
679+ Map <String , Object > explainResponse = explainIndex (client (), downsampleIndexName );
680+ assertThat (explainResponse .get ("step" ), is (PhaseCompleteStep .NAME ));
681+ assertThat (explainResponse .get ("phase" ), is ("cold" ));
679682 Map <String , Object > settings = getOnlyIndexSettings (client (), downsampleIndexName );
680683 assertEquals (
681684 DownsampleConfig .SamplingMethod .getOrDefault (initialSamplingMethod ).toString (),
0 commit comments