Pārlūkot izejas kodu

Fix CancelTests#testDeleteByQueryCancelWithWorkers (#56242)

We need to relax the assertion as a TaskCancelledException
can be suppressed instead.

Closes #55647
Nhat Nguyen 5 gadi atpakaļ
vecāks
revīzija
d53c9e4e86

+ 1 - 1
modules/reindex/src/test/java/org/elasticsearch/index/reindex/CancelTests.java

@@ -177,7 +177,7 @@ public class CancelTests extends ReindexTestCase {
         try {
             response = future.get(30, TimeUnit.SECONDS);
         } catch (Exception e) {
-            if (ExceptionsHelper.unwrap(e, TaskCancelledException.class) != null) {
+            if (ExceptionsHelper.unwrapCausesAndSuppressed(e, t -> t instanceof TaskCancelledException).isPresent()) {
                 return; // the scroll request was cancelled
             }
             String tasks = client().admin().cluster().prepareListTasks().setParentTaskId(mainTask.getTaskId())