This is an automated email from the ASF dual-hosted git repository. MartijnVisser pushed a commit to branch release-2.3 in repository https://gitbox.apache.org/repos/asf/flink.git
commit 0fc5a00df34cd4bb517c0dba79678b9c7d3b4bc8 Author: Chan hae OH <[email protected]> AuthorDate: Wed Jun 24 14:05:38 2026 +0900 [FLINK-39929][runtime/tests] Fix the flaky test case ExecutionTimeBasedSlowTaskDetectorTest due to unexepected ComponentMainThreadExecutor setting. (#28434) Co-authored-by: Yuepeng Pan <[email protected]> (cherry picked from commit 67eba4581147ac527fb7804687ca24745dde08da) --- .../ExecutionTimeBasedSlowTaskDetectorTest.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/slowtaskdetector/ExecutionTimeBasedSlowTaskDetectorTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/slowtaskdetector/ExecutionTimeBasedSlowTaskDetectorTest.java index 5ec9baeb3cc..d01a095a66c 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/slowtaskdetector/ExecutionTimeBasedSlowTaskDetectorTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/slowtaskdetector/ExecutionTimeBasedSlowTaskDetectorTest.java @@ -22,10 +22,12 @@ package org.apache.flink.runtime.scheduler.slowtaskdetector; import org.apache.flink.configuration.Configuration; import org.apache.flink.configuration.SlowTaskDetectorOptions; import org.apache.flink.runtime.concurrent.ComponentMainThreadExecutorServiceAdapter; +import org.apache.flink.runtime.concurrent.NoMainThreadCheckComponentMainThreadExecutor; import org.apache.flink.runtime.executiongraph.ExecutionAttemptID; import org.apache.flink.runtime.executiongraph.ExecutionGraph; import org.apache.flink.runtime.executiongraph.ExecutionGraphTestUtils; import org.apache.flink.runtime.executiongraph.ExecutionVertex; +import org.apache.flink.runtime.executiongraph.utils.ExecutionUtils; import org.apache.flink.runtime.io.network.partition.ResultPartitionType; import org.apache.flink.runtime.jobgraph.DistributionPattern; import org.apache.flink.runtime.jobgraph.JobGraph; @@ -91,7 +93,7 @@ class ExecutionTimeBasedSlowTaskDetectorTest { final ExecutionGraph executionGraph = SchedulerTestingUtils.createScheduler( jobGraph, - ComponentMainThreadExecutorServiceAdapter.forMainThread(), + new NoMainThreadCheckComponentMainThreadExecutor(), EXECUTOR_RESOURCE.getExecutor()) .getExecutionGraph(); @@ -433,12 +435,15 @@ class ExecutionTimeBasedSlowTaskDetectorTest { final SchedulerBase scheduler = SchedulerTestingUtils.createScheduler( jobGraph, - ComponentMainThreadExecutorServiceAdapter.forMainThread(), + new NoMainThreadCheckComponentMainThreadExecutor(), EXECUTOR_RESOURCE.getExecutor()); final ExecutionGraph executionGraph = scheduler.getExecutionGraph(); scheduler.startScheduling(); + for (ExecutionVertex ev : executionGraph.getAllExecutionVertices()) { + ExecutionUtils.waitForTaskDeploymentDescriptorsCreation(ev); + } ExecutionGraphTestUtils.switchAllVerticesToRunning(executionGraph); return executionGraph; @@ -450,13 +455,16 @@ class ExecutionTimeBasedSlowTaskDetectorTest { final SchedulerBase scheduler = new DefaultSchedulerBuilder( jobGraph, - ComponentMainThreadExecutorServiceAdapter.forMainThread(), + new NoMainThreadCheckComponentMainThreadExecutor(), EXECUTOR_RESOURCE.getExecutor()) .buildAdaptiveBatchJobScheduler(); final ExecutionGraph executionGraph = scheduler.getExecutionGraph(); scheduler.startScheduling(); + for (ExecutionVertex ev : executionGraph.getAllExecutionVertices()) { + ExecutionUtils.waitForTaskDeploymentDescriptorsCreation(ev); + } ExecutionGraphTestUtils.switchAllVerticesToRunning(executionGraph); return executionGraph;
