3030import org .elasticsearch .test .rest .ESRestTestCase ;
3131import org .elasticsearch .xpack .core .ilm .AllocateAction ;
3232import org .elasticsearch .xpack .core .ilm .DeleteAction ;
33- import org .elasticsearch .xpack .core .ilm .DeleteStep ;
3433import org .elasticsearch .xpack .core .ilm .ForceMergeAction ;
3534import org .elasticsearch .xpack .core .ilm .FreezeAction ;
36- import org .elasticsearch .xpack .core .ilm .FreezeStep ;
3735import org .elasticsearch .xpack .core .ilm .InitializePolicyContextStep ;
3836import org .elasticsearch .xpack .core .ilm .LifecycleAction ;
3937import org .elasticsearch .xpack .core .ilm .LifecyclePolicy ;
@@ -211,22 +209,19 @@ public void testMoveToRolloverStep() throws Exception {
211209 assertBusy (() -> assertFalse (indexExists (shrunkenOriginalIndex )));
212210 }
213211
214- @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/53738" )
215212 public void testRetryFailedDeleteAction () throws Exception {
213+ createNewSingletonPolicy ("delete" , new DeleteAction ());
216214 createIndexWithSettings (index , Settings .builder ()
217215 .put (IndexMetadata .SETTING_NUMBER_OF_SHARDS , 1 )
218216 .put (IndexMetadata .SETTING_NUMBER_OF_REPLICAS , 0 )
219- .put (IndexMetadata .SETTING_READ_ONLY_ALLOW_DELETE , false ));
220-
221- createNewSingletonPolicy ("delete" , new DeleteAction ());
222-
223- Request request = new Request ("PUT" , index + "/_settings" );
224- request .setJsonEntity ("{\" index.blocks.read_only\" : true, \" index.lifecycle.name\" : \" " + policy + "\" }" );
225- assertOK (client ().performRequest (request ));
217+ .put (IndexMetadata .SETTING_READ_ONLY , true )
218+ .put ("index.lifecycle.name" , policy ));
226219
227- assertBusy (() -> assertThat (getFailedStepForIndex (index ), equalTo (DeleteStep .NAME )));
220+ assertBusy (() -> assertThat ((Integer ) explainIndex (index ).get (FAILED_STEP_RETRY_COUNT_FIELD ), greaterThanOrEqualTo (1 )), 30 ,
221+ TimeUnit .SECONDS );
228222 assertTrue (indexExists (index ));
229223
224+ Request request = new Request ("PUT" , index + "/_settings" );
230225 request .setJsonEntity ("{\" index.blocks.read_only\" :false}" );
231226 assertOK (client ().performRequest (request ));
232227
@@ -242,7 +237,8 @@ public void testRetryFreezeDeleteAction() throws Exception {
242237 .put (IndexMetadata .SETTING_READ_ONLY , true )
243238 .put ("index.lifecycle.name" , policy ));
244239
245- assertBusy (() -> assertThat (getFailedStepForIndex (index ), equalTo (FreezeStep .NAME )));
240+ assertBusy (() -> assertThat ((Integer ) explainIndex (index ).get (FAILED_STEP_RETRY_COUNT_FIELD ), greaterThanOrEqualTo (1 )), 30 ,
241+ TimeUnit .SECONDS );
246242 assertFalse (getOnlyIndexSettings (index ).containsKey ("index.frozen" ));
247243
248244 Request request = new Request ("PUT" , index + "/_settings" );
@@ -287,7 +283,6 @@ public void testRetryFailedShrinkAction() throws Exception {
287283 expectThrows (ResponseException .class , this ::indexDocument );
288284 }
289285
290- @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/53738" )
291286 public void testRolloverAction () throws Exception {
292287 String originalIndex = index + "-000001" ;
293288 String secondIndex = index + "-000002" ;
@@ -306,7 +301,6 @@ public void testRolloverAction() throws Exception {
306301 assertBusy (() -> assertEquals ("true" , getOnlyIndexSettings (originalIndex ).get (LifecycleSettings .LIFECYCLE_INDEXING_COMPLETE )));
307302 }
308303
309- @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/53738" )
310304 public void testRolloverActionWithIndexingComplete () throws Exception {
311305 String originalIndex = index + "-000001" ;
312306 String secondIndex = index + "-000002" ;
@@ -759,7 +753,6 @@ public void testFreezeDuringSnapshot() throws Exception {
759753 assertOK (client ().performRequest (new Request ("DELETE" , "/_snapshot/repo/snapshot" )));
760754 }
761755
762- @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/53738" )
763756 public void testSetPriority () throws Exception {
764757 createIndexWithSettings (index , Settings .builder ().put (IndexMetadata .SETTING_NUMBER_OF_SHARDS , 1 )
765758 .put (IndexMetadata .SETTING_NUMBER_OF_REPLICAS , 0 ).put (IndexMetadata .INDEX_PRIORITY_SETTING .getKey (), 100 ));
@@ -1912,6 +1905,7 @@ private static StepKey getStepKey(Map<String, Object> explainIndexResponse) {
19121905 return new StepKey (phase , action , step );
19131906 }
19141907
1908+ @ Nullable
19151909 private String getFailedStepForIndex (String indexName ) throws IOException {
19161910 Map <String , Object > indexResponse = explainIndex (indexName );
19171911 if (indexResponse == null ) {
0 commit comments