Skip to content

Commit 9d7213b

Browse files
authored
Fix CCS cancellation test (#117790) (#117800)
We should have checked that all drivers were canceled, not cancellable (which is always true), before unblocking the compute tasks. Closes #117568
1 parent bbbe8a6 commit 9d7213b

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClustersCancellationIT.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -179,19 +179,22 @@ public void testCancel() throws Exception {
179179
});
180180
var cancelRequest = new CancelTasksRequest().setTargetTaskId(rootTasks.get(0).taskId()).setReason("proxy timeout");
181181
client().execute(TransportCancelTasksAction.TYPE, cancelRequest);
182-
assertBusy(() -> {
183-
List<TaskInfo> drivers = client(REMOTE_CLUSTER).admin()
184-
.cluster()
185-
.prepareListTasks()
186-
.setActions(DriverTaskRunner.ACTION_NAME)
187-
.get()
188-
.getTasks();
189-
assertThat(drivers.size(), greaterThanOrEqualTo(1));
190-
for (TaskInfo driver : drivers) {
191-
assertTrue(driver.cancellable());
192-
}
193-
});
194-
PauseFieldPlugin.allowEmitting.countDown();
182+
try {
183+
assertBusy(() -> {
184+
List<TaskInfo> drivers = client(REMOTE_CLUSTER).admin()
185+
.cluster()
186+
.prepareListTasks()
187+
.setActions(DriverTaskRunner.ACTION_NAME)
188+
.get()
189+
.getTasks();
190+
assertThat(drivers.size(), greaterThanOrEqualTo(1));
191+
for (TaskInfo driver : drivers) {
192+
assertTrue(driver.cancelled());
193+
}
194+
});
195+
} finally {
196+
PauseFieldPlugin.allowEmitting.countDown();
197+
}
195198
Exception error = expectThrows(Exception.class, requestFuture::actionGet);
196199
assertThat(error.getMessage(), containsString("proxy timeout"));
197200
}

0 commit comments

Comments
 (0)