Skip to content

Commit

Permalink
Fix CCS cancellation test (#117790)
Browse files Browse the repository at this point in the history
We should have checked that all drivers were canceled, not cancellable 
(which is always true), before unblocking the compute tasks.

Closes #117568
  • Loading branch information
dnhatn authored Dec 1, 2024
1 parent 31cb0f6 commit bda415b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,6 @@ tests:
- class: org.elasticsearch.search.ccs.CrossClusterIT
method: testCancel
issue: https://github.com/elastic/elasticsearch/issues/108061
- class: org.elasticsearch.xpack.esql.action.CrossClustersCancellationIT
method: testCancel
issue: https://github.com/elastic/elasticsearch/issues/117568

# Examples:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,22 @@ public void testCancel() throws Exception {
});
var cancelRequest = new CancelTasksRequest().setTargetTaskId(rootTasks.get(0).taskId()).setReason("proxy timeout");
client().execute(TransportCancelTasksAction.TYPE, cancelRequest);
assertBusy(() -> {
List<TaskInfo> drivers = client(REMOTE_CLUSTER).admin()
.cluster()
.prepareListTasks()
.setActions(DriverTaskRunner.ACTION_NAME)
.get()
.getTasks();
assertThat(drivers.size(), greaterThanOrEqualTo(1));
for (TaskInfo driver : drivers) {
assertTrue(driver.cancellable());
}
});
PauseFieldPlugin.allowEmitting.countDown();
try {
assertBusy(() -> {
List<TaskInfo> drivers = client(REMOTE_CLUSTER).admin()
.cluster()
.prepareListTasks()
.setActions(DriverTaskRunner.ACTION_NAME)
.get()
.getTasks();
assertThat(drivers.size(), greaterThanOrEqualTo(1));
for (TaskInfo driver : drivers) {
assertTrue(driver.cancelled());
}
});
} finally {
PauseFieldPlugin.allowEmitting.countDown();
}
Exception error = expectThrows(Exception.class, requestFuture::actionGet);
assertThat(error.getMessage(), containsString("proxy timeout"));
}
Expand Down

0 comments on commit bda415b

Please sign in to comment.