This is an automated email from the ASF dual-hosted git repository.
MartijnVisser pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new 07805482705 [FLINK-40682][tests] Fix unstable
ArchivedExecutionGraphTest and CachedShuffleDescriptorsTest
07805482705 is described below
commit 07805482705f4b703cd19517ecedf12014b7b762
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;