@@ -366,20 +366,18 @@ public void onFailure(Exception e) {
366366
367367 updateLatch .await (5 , TimeUnit .SECONDS );
368368
369- // Delete a rule fails
369+ // Delete a rule does not fail
370370 CountDownLatch deleteLatch = new CountDownLatch (1 );
371371 synonymsManagementAPIService .deleteSynonymRule (synonymSetId , synonymRuleId , true , new ActionListener <>() {
372372 @ Override
373373 public void onResponse (SynonymsManagementAPIService .SynonymsReloadResult synonymsReloadResult ) {
374- fail ( "Shouldn't have been able to delete a synonym rule with refresh in synonyms index health" );
374+ updateLatch . countDown ( );
375375 }
376376
377377 @ Override
378378 public void onFailure (Exception e ) {
379379 // Expected
380- assertTrue (e instanceof IndexCreationException );
381- assertTrue (e .getMessage ().contains ("synonyms index [.synonyms] is not searchable" ));
382- updateLatch .countDown ();
380+ fail ("Should have been able to delete a synonym rule" );
383381 }
384382 });
385383
@@ -418,21 +416,5 @@ public void onFailure(Exception e) {
418416 });
419417
420418 putRuleNoRefreshLatch .await (5 , TimeUnit .SECONDS );
421-
422- // Same for delete
423- CountDownLatch deleteNoRefreshLatch = new CountDownLatch (1 );
424- synonymsManagementAPIService .deleteSynonymRule (synonymSetId , synonymRuleId , false , new ActionListener <>() {
425- @ Override
426- public void onResponse (SynonymsManagementAPIService .SynonymsReloadResult synonymsReloadResult ) {
427- deleteNoRefreshLatch .countDown ();
428- }
429-
430- @ Override
431- public void onFailure (Exception e ) {
432- fail (e );
433- }
434- });
435-
436- deleteNoRefreshLatch .await (5 , TimeUnit .SECONDS );
437419 }
438420}
0 commit comments