Skip to content

Commit da1612e

Browse files
committed
Update condition to only target remote_reduce
1 parent b2d81e8 commit da1612e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
1111
import org.elasticsearch.common.bytes.BytesReference;
1212
import org.elasticsearch.common.xcontent.XContentHelper;
13+
import org.elasticsearch.compute.operator.DriverStatus;
1314
import org.elasticsearch.plugins.Plugin;
1415
import org.elasticsearch.tasks.TaskInfo;
1516
import org.elasticsearch.xcontent.json.JsonXContent;
@@ -94,10 +95,12 @@ public void testEnrichAfterStop() throws Exception {
9495
// Run the stop request
9596
var stopRequest = new AsyncStopRequest(asyncExecutionId);
9697
var stopAction = client().execute(EsqlAsyncStopAction.INSTANCE, stopRequest);
97-
// wait until reduce tasks are gone
98+
// wait until remote reduce tasks are gone
9899
assertBusy(() -> {
99100
List<TaskInfo> tasks = getDriverTasks(client(REMOTE_CLUSTER_2));
100-
List<TaskInfo> reduceTasks = tasks.stream().filter(t -> t.description().contains("_LuceneSourceOperator") == false).toList();
101+
List<TaskInfo> reduceTasks = tasks.stream()
102+
.filter(t -> t.status() instanceof DriverStatus ds && ds.taskDescription().equals("remote_reduce"))
103+
.toList();
101104
assertThat(reduceTasks, empty());
102105
});
103106

0 commit comments

Comments
 (0)