Skip to content

Commit 7a42657

Browse files
committed
Fix tests
1 parent 7743835 commit 7a42657

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

server/src/internalClusterTest/java/org/elasticsearch/synonyms/SynonymsManagementAPIServiceIT.java

+3-21
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)