### CI Link

https://gradle-enterprise.elastic.co/s/sa7kgcpbjsuyo

### Repro line

./gradlew ':x-pack:plugin:esql:internalClusterTest' --tests "org.elasticsearch.xpack.esql.action.EsqlActionTaskIT.testCancelRead" -Dtests.seed=A10FD59C7183AD95 -Dbuild.snapshot=false -Dtests.jvm.argline="-Dbuild.snapshot=false" -Dtests.locale=ga-IE -Dtests.timezone=Europe/Stockholm -Druntime.java=20

### Does it reproduce?

No

### Applicable branches

main

### Failure history

_No response_

### Failure excerpt

```
org.elasticsearch.xpack.esql.action.EsqlActionTaskIT > testCancelRead FAILED
    java.lang.AssertionError: 
    Expected: a collection with size <2>
         but: collection size was <0>
        at __randomizedtesting.SeedInfo.seed([A10FD59C7183AD95:34226718C99014F4]:0)
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
        at org.junit.Assert.assertThat(Assert.java:956)
        at org.junit.Assert.assertThat(Assert.java:923)
        at org.elasticsearch.xpack.esql.action.EsqlActionTaskIT.lambda$getTasksStarting$2(EsqlActionTaskIT.java:229)
        at org.elasticsearch.test.ESTestCase.assertBusy(ESTestCase.java:1196)
        at org.elasticsearch.test.ESTestCase.assertBusy(ESTestCase.java:1169)
        at org.elasticsearch.xpack.esql.action.EsqlActionTaskIT.getTasksStarting(EsqlActionTaskIT.java:221)
        at org.elasticsearch.xpack.esql.action.EsqlActionTaskIT.testCancelRead(EsqlActionTaskIT.java:167)
```
x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/EsqlActionTaskIT.java
import org.elasticsearch.script.ScriptEngine;
import org.elasticsearch.search.lookup.SearchLookup;
import org.elasticsearch.tasks.TaskCancelledException;
import org.elasticsearch.tasks.TaskId;
import org.elasticsearch.tasks.TaskInfo;
import org.elasticsearch.test.junit.annotations.TestLogging;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xcontent.json.JsonXContent;
import org.elasticsearch.xpack.esql.plugin.QueryPragmas;
import org.junit.Before;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import static org.hamcrest.Matchers.either;
import static org.hamcrest.Matchers.emptyIterable;
import static org.hamcrest.Matchers.emptyOrNullString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.lessThanOrEqualTo;
import static org.hamcrest.Matchers.not;
/**
 * Tests that we expose a reasonable task status.
 */
@TestLogging(