@@ -111,7 +111,7 @@ public void testSearchableSnapshotAction() throws Exception {
111111 assertThat (backingIndices .size (), equalTo (2 ));
112112 String backingIndexName = backingIndices .getFirst ();
113113 String restoredIndexName = SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX + backingIndexName ;
114- awaitIndexExists (restoredIndexName );
114+ awaitIndexExists (restoredIndexName , TimeValue . timeValueSeconds ( 20 ) );
115115
116116 TimeSeriesRestDriver .awaitStepKey (client (), restoredIndexName , null , null , PhaseCompleteStep .NAME );
117117 // Wait for the original index to be deleted, to ensure ILM has finished
@@ -233,7 +233,7 @@ public void testDeleteActionDeletesSearchableSnapshot() throws Exception {
233233 Map <String , LifecycleAction > coldActions = Map .of (SearchableSnapshotAction .NAME , new SearchableSnapshotAction (snapshotRepo ));
234234 Map <String , Phase > phases = new HashMap <>();
235235 phases .put ("cold" , new Phase ("cold" , TimeValue .ZERO , coldActions ));
236- phases .put ("delete" , new Phase ("delete" , TimeValue .timeValueMillis ( 10000 ) , Map .of (DeleteAction .NAME , WITH_SNAPSHOT_DELETE )));
236+ phases .put ("delete" , new Phase ("delete" , TimeValue .ZERO , Map .of (DeleteAction .NAME , WITH_SNAPSHOT_DELETE )));
237237 LifecyclePolicy lifecyclePolicy = new LifecyclePolicy (policy , phases );
238238 // PUT policy
239239 XContentBuilder builder = jsonBuilder ();
@@ -261,7 +261,7 @@ public void testDeleteActionDeletesSearchableSnapshot() throws Exception {
261261 String restoredIndexName = SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX + backingIndexName ;
262262
263263 // let's wait for ILM to finish
264- awaitIndexDoesNotExist (backingIndexName );
264+ awaitIndexDoesNotExist (backingIndexName , TimeValue . timeValueSeconds ( 20 ) );
265265 awaitIndexDoesNotExist (restoredIndexName );
266266
267267 List <Map <String , Object >> snapshots = getSnapshots ();
@@ -347,7 +347,7 @@ public void testUpdatePolicyToAddPhasesYieldsInvalidActionsToBeSkipped() throws
347347
348348 String backingIndexName = backingIndices .getFirst ();
349349 String restoredIndexName = SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX + backingIndexName ;
350- awaitIndexExists (restoredIndexName );
350+ awaitIndexExists (restoredIndexName , TimeValue . timeValueSeconds ( 20 ) );
351351 TimeSeriesRestDriver .awaitStepKey (client (), restoredIndexName , "hot" , null , PhaseCompleteStep .NAME );
352352 // Wait for the original index to be deleted, to ensure ILM has finished
353353 awaitIndexDoesNotExist (backingIndexName );
@@ -417,7 +417,7 @@ public void testRestoredIndexManagedByLocalPolicySkipsIllegalActions() throws Ex
417417
418418 String backingIndexName = backingIndices .getFirst ();
419419 String searchableSnapMountedIndexName = SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX + backingIndexName ;
420- awaitIndexExists (searchableSnapMountedIndexName );
420+ awaitIndexExists (searchableSnapMountedIndexName , TimeValue . timeValueSeconds ( 20 ) );
421421 TimeSeriesRestDriver .awaitStepKey (client (), searchableSnapMountedIndexName , "hot" , null , PhaseCompleteStep .NAME );
422422 // Wait for the original index to be deleted, to ensure ILM has finished
423423 awaitIndexDoesNotExist (backingIndexName );
@@ -459,7 +459,7 @@ public void testRestoredIndexManagedByLocalPolicySkipsIllegalActions() throws Ex
459459 restoreSnapshot .setJsonEntity ("{\" indices\" : \" " + dataStream + "\" , \" include_global_state\" : false}" );
460460 assertOK (client ().performRequest (restoreSnapshot ));
461461
462- assertThat ( indexExists ( searchableSnapMountedIndexName ), is ( true ) );
462+ awaitIndexExists ( searchableSnapMountedIndexName );
463463 ensureGreen (searchableSnapMountedIndexName );
464464
465465 // the restored index is now managed by the now updated ILM policy and needs to go through the warm and cold phase
@@ -523,7 +523,7 @@ public void testIdenticalSearchableSnapshotActionIsNoop() throws Exception {
523523 final String searchableSnapMountedIndexName = SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX + index ;
524524
525525 logger .info ("--> waiting for [{}] to exist..." , searchableSnapMountedIndexName );
526- awaitIndexExists (searchableSnapMountedIndexName );
526+ awaitIndexExists (searchableSnapMountedIndexName , TimeValue . timeValueSeconds ( 20 ) );
527527 TimeSeriesRestDriver .awaitStepKey (client (), searchableSnapMountedIndexName , "cold" , null , PhaseCompleteStep .NAME );
528528 // Wait for the original index to be deleted, to ensure ILM has finished
529529 awaitIndexDoesNotExist (index );
@@ -569,7 +569,7 @@ public void testConvertingSearchableSnapshotFromFullToPartial() throws Exception
569569 + SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX + index ;
570570
571571 logger .info ("--> waiting for [{}] to exist..." , searchableSnapMountedIndexName );
572- awaitIndexExists (searchableSnapMountedIndexName );
572+ awaitIndexExists (searchableSnapMountedIndexName , TimeValue . timeValueSeconds ( 20 ) );
573573 TimeSeriesRestDriver .awaitStepKey (client (), searchableSnapMountedIndexName , "frozen" , null , PhaseCompleteStep .NAME );
574574 // Wait for the original index to be deleted, to ensure ILM has finished
575575 awaitIndexDoesNotExist (index );
@@ -635,7 +635,7 @@ public void testResumingSearchableSnapshotFromFullToPartial() throws Exception {
635635
636636 final String fullMountedIndexName = SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX + index ;
637637 logger .info ("--> waiting for [{}] to exist..." , fullMountedIndexName );
638- awaitIndexExists (fullMountedIndexName );
638+ awaitIndexExists (fullMountedIndexName , TimeValue . timeValueSeconds ( 20 ) );
639639 TimeSeriesRestDriver .awaitStepKey (client (), fullMountedIndexName , "cold" , null , PhaseCompleteStep .NAME );
640640 // Wait for the original index to be deleted, to ensure ILM has finished
641641 awaitIndexDoesNotExist (index );
@@ -651,7 +651,7 @@ public void testResumingSearchableSnapshotFromFullToPartial() throws Exception {
651651
652652 String partiallyMountedIndexName = SearchableSnapshotAction .PARTIAL_RESTORED_INDEX_PREFIX + fullMountedIndexName ;
653653 logger .info ("--> waiting for [{}] to exist..." , partiallyMountedIndexName );
654- awaitIndexExists (partiallyMountedIndexName );
654+ awaitIndexExists (partiallyMountedIndexName , TimeValue . timeValueSeconds ( 20 ) );
655655 TimeSeriesRestDriver .awaitStepKey (client (), partiallyMountedIndexName , "frozen" , null , PhaseCompleteStep .NAME );
656656
657657 // Ensure the searchable snapshot is not deleted when the index was deleted because it was not created by this
@@ -727,7 +727,7 @@ public void testResumingSearchableSnapshotFromPartialToFull() throws Exception {
727727 final String fullMountedIndexName = SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX + index ;
728728 final String partialMountedIndexName = SearchableSnapshotAction .PARTIAL_RESTORED_INDEX_PREFIX + fullMountedIndexName ;
729729 logger .info ("--> waiting for [{}] to exist..." , partialMountedIndexName );
730- awaitIndexExists (partialMountedIndexName );
730+ awaitIndexExists (partialMountedIndexName , TimeValue . timeValueSeconds ( 20 ) );
731731 TimeSeriesRestDriver .awaitStepKey (client (), partialMountedIndexName , "frozen" , null , PhaseCompleteStep .NAME );
732732 // Wait for the original index to be deleted, to ensure ILM has finished
733733 awaitIndexDoesNotExist (index );
@@ -743,7 +743,7 @@ public void testResumingSearchableSnapshotFromPartialToFull() throws Exception {
743743
744744 String restoredPartiallyMountedIndexName = SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX + partialMountedIndexName ;
745745 logger .info ("--> waiting for [{}] to exist..." , restoredPartiallyMountedIndexName );
746- awaitIndexExists (restoredPartiallyMountedIndexName );
746+ awaitIndexExists (restoredPartiallyMountedIndexName , TimeValue . timeValueSeconds ( 20 ) );
747747 TimeSeriesRestDriver .awaitStepKey (client (), restoredPartiallyMountedIndexName , "cold" , null , PhaseCompleteStep .NAME );
748748
749749 // Ensure the searchable snapshot is not deleted when the index was deleted because it was not created by this
@@ -848,7 +848,7 @@ public void testSearchableSnapshotsInHotPhasePinnedToHotNodes() throws Exception
848848
849849 final String restoredIndex = SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX + firstGenIndex ;
850850 logger .info ("--> waiting for [{}] to exist..." , restoredIndex );
851- awaitIndexExists (restoredIndex );
851+ awaitIndexExists (restoredIndex , TimeValue . timeValueSeconds ( 20 ) );
852852 TimeSeriesRestDriver .awaitStepKey (client (), restoredIndex , "hot" , PhaseCompleteStep .NAME , PhaseCompleteStep .NAME );
853853
854854 Map <String , Object > hotIndexSettings = getIndexSettingsAsMap (restoredIndex );
@@ -887,7 +887,7 @@ public void testSearchableSnapshotInvokesAsyncActionOnNewIndex() throws Exceptio
887887 assertThat (backingIndices .size (), equalTo (2 ));
888888 String backingIndexName = backingIndices .getFirst ();
889889 String restoredIndexName = SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX + backingIndexName ;
890- awaitIndexExists (restoredIndexName );
890+ awaitIndexExists (restoredIndexName , TimeValue . timeValueSeconds ( 20 ) );
891891
892892 TimeSeriesRestDriver .awaitStepKey (client (), restoredIndexName , null , null , PhaseCompleteStep .NAME );
893893 // Wait for the original index to be deleted, to ensure ILM has finished
@@ -931,7 +931,7 @@ public void testSearchableSnapshotTotalShardsPerNode() throws Exception {
931931 final String searchableSnapMountedIndexName = SearchableSnapshotAction .PARTIAL_RESTORED_INDEX_PREFIX
932932 + SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX + index ;
933933 logger .info ("--> waiting for [{}] to exist..." , searchableSnapMountedIndexName );
934- awaitIndexExists (searchableSnapMountedIndexName );
934+ awaitIndexExists (searchableSnapMountedIndexName , TimeValue . timeValueSeconds ( 20 ) );
935935 TimeSeriesRestDriver .awaitStepKey (client (), searchableSnapMountedIndexName , "frozen" , null , PhaseCompleteStep .NAME );
936936 // Wait for the original index to be deleted, to ensure ILM has finished
937937 awaitIndexDoesNotExist (index );
@@ -984,7 +984,7 @@ public void testSearchableSnapshotReplicateFor() throws Exception {
984984 assertThat (backingIndices .size (), equalTo (2 ));
985985 String backingIndexName = backingIndices .getFirst ();
986986 String restoredIndexName = SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX + backingIndexName ;
987- awaitIndexExists (restoredIndexName );
987+ awaitIndexExists (restoredIndexName , TimeValue . timeValueSeconds ( 20 ) );
988988
989989 // check that the index is in the expected step and has the expected step_info.message
990990 assertBusy (() -> {
@@ -1133,7 +1133,7 @@ private void assertForceMergedSnapshotDone(String phase, String backingIndexName
11331133 ? SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX
11341134 : SearchableSnapshotAction .PARTIAL_RESTORED_INDEX_PREFIX ;
11351135 final String restoredIndexName = prefix + backingIndexName ;
1136- awaitIndexExists (restoredIndexName );
1136+ awaitIndexExists (restoredIndexName , TimeValue . timeValueSeconds ( 20 ) );
11371137
11381138 assertBusy (() -> assertThat (explainIndex (client (), restoredIndexName ).get ("step" ), is (PhaseCompleteStep .NAME )));
11391139 // Wait for the original index to be deleted, to ensure ILM has finished
0 commit comments