This is an automated email from the ASF dual-hosted git repository.

MartijnVisser pushed a commit to branch release-2.2
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-2.2 by this push:
     new c48fc0d2328 [FLINK-40682][tests] Fix unstable 
ArchivedExecutionGraphTest and CachedShuffleDescriptorsTest
c48fc0d2328 is described below

commit c48fc0d2328746ec6d7d3d182fcc8fd68e6e85e8
Author: SEPURI-SAI-KRISHNA <[email protected]>
AuthorDate: Wed Sep 16 17:01:00 2026 +0530

    [FLINK-40682][tests] Fix unstable ArchivedExecutionGraphTest and 
CachedShuffleDescriptorsTest
    
    Generated-by: Claude Code (Opus 5)
---
 .../runtime/deployment/CachedShuffleDescriptorsTest.java      | 11 +++++++----
 .../runtime/executiongraph/ArchivedExecutionGraphTest.java    | 11 +++++++----
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/deployment/CachedShuffleDescriptorsTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/deployment/CachedShuffleDescriptorsTest.java
index 699a751120f..16e1b31b76c 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/deployment/CachedShuffleDescriptorsTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/deployment/CachedShuffleDescriptorsTest.java
@@ -37,7 +37,7 @@ import org.apache.flink.runtime.scheduler.SchedulerBase;
 import org.apache.flink.runtime.scheduler.strategy.ConsumedPartitionGroup;
 import org.apache.flink.runtime.shuffle.ShuffleDescriptor;
 import org.apache.flink.runtime.testtasks.NoOpInvokable;
-import org.apache.flink.testutils.TestingUtils;
+import org.apache.flink.runtime.testutils.DirectScheduledExecutorService;
 import org.apache.flink.testutils.executor.TestExecutorExtension;
 import org.apache.flink.util.CompressedSerializedValue;
 
@@ -48,7 +48,6 @@ import java.io.IOException;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
-import java.util.concurrent.ScheduledExecutorService;
 
 import static org.apache.flink.runtime.jobgraph.DistributionPattern.ALL_TO_ALL;
 import static 
org.apache.flink.runtime.util.JobVertexConnectionUtils.connectNewDataSetAsInput;
@@ -56,9 +55,13 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 /** Tests for {@link CachedShuffleDescriptors}. */
 class CachedShuffleDescriptorsTest {
+    /**
+     * Future executor that runs the deployment callbacks inline on the test 
thread instead of
+     * racing it from another thread (FLINK-40682).
+     */
     @RegisterExtension
-    static final TestExecutorExtension<ScheduledExecutorService> 
EXECUTOR_RESOURCE =
-            TestingUtils.defaultExecutorExtension();
+    static final TestExecutorExtension<DirectScheduledExecutorService> 
EXECUTOR_RESOURCE =
+            new TestExecutorExtension<>(DirectScheduledExecutorService::new);
 
     @Test
     void testCreateAndGet() throws Exception {
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionGraphTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionGraphTest.java
index f69c2e0df0f..5baafbca963 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionGraphTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionGraphTest.java
@@ -41,9 +41,9 @@ import 
org.apache.flink.runtime.scheduler.DefaultVertexParallelismStore;
 import org.apache.flink.runtime.scheduler.SchedulerBase;
 import org.apache.flink.runtime.scheduler.SchedulerTestingUtils;
 import org.apache.flink.runtime.taskmanager.TaskExecutionState;
+import org.apache.flink.runtime.testutils.DirectScheduledExecutorService;
 import org.apache.flink.runtime.util.stats.StatsSummarySnapshot;
 import org.apache.flink.streaming.util.RestartStrategyUtils;
-import org.apache.flink.testutils.TestingUtils;
 import org.apache.flink.testutils.executor.TestExecutorExtension;
 
 import org.junit.jupiter.api.BeforeAll;
@@ -57,7 +57,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
-import java.util.concurrent.ScheduledExecutorService;
 import java.util.function.Function;
 
 import static java.util.Arrays.asList;
@@ -66,9 +65,13 @@ import static org.assertj.core.api.Assertions.assertThat;
 /** Tests for the {@link ArchivedExecutionGraph}. */
 public class ArchivedExecutionGraphTest {
 
+    /**
+     * Runs the deployment callbacks inline, so they cannot race 
startScheduling() on another thread
+     * (FLINK-40682).
+     */
     @RegisterExtension
-    static final TestExecutorExtension<ScheduledExecutorService> 
EXECUTOR_RESOURCE =
-            TestingUtils.defaultExecutorExtension();
+    static final TestExecutorExtension<DirectScheduledExecutorService> 
EXECUTOR_RESOURCE =
+            new TestExecutorExtension<>(DirectScheduledExecutorService::new);
 
     private static ExecutionGraph runtimeGraph;
 

Reply via email to