[
https://issues.apache.org/jira/browse/FLINK-40793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18121208#comment-18121208
]
sepuri sai krishna commented on FLINK-40793:
--------------------------------------------
Thanks [~martijnvisser]. That one is covered by the PR as it stands.
testExceptionHistoryWithGlobalFailOver builds its scheduler through
createSchedulerAndStartScheduling, which goes through createSchedulerBuilder,
and that is the method the patch changes: the future executor becomes a
DirectScheduledExecutorService, so the deployment callbacks run on the test
thread instead of racing it. Every createScheduler helper in the class routes
through there, so the methods that have not failed yet are covered too.
The one place that builds a scheduler directly is
testCheckpointCleanerIsClosedAfterCheckpointServices. It uses a real
single-threaded main thread executor and never calls startScheduling, so it is
not exposed to this and I left it as it is.
The extra history entry in your log is the first deployment failing on the main
thread check before the global failover, which is what goes away.
The PR is out of draft and CI is green, it just needs a review:
https://github.com/apache/flink/pull/29278
It targets master. DefaultSchedulerTest.java is byte-identical on release-2.3
and release-2.2, so I can put the backports up as soon as this one is merged.
> DefaultSchedulerTest is unstable across many test methods
> ---------------------------------------------------------
>
> Key: FLINK-40793
> URL: https://issues.apache.org/jira/browse/FLINK-40793
> Project: Flink
> Issue Type: Bug
> Components: Runtime / Coordination
> Affects Versions: 2.2.0, 2.3.1, 2.4.0
> Reporter: sepuri sai krishna
> Assignee: sepuri sai krishna
> Priority: Major
> Labels: pull-request-available, test-stability
>
> DefaultSchedulerTest failed 17 times in the 90 days to 2026-09-15, in 11
> different test methods, on all core CI profiles (Java 11, 17, 21, Hadoop,
> AdaptiveScheduler). It is not limited to master: the most recent two are
> 2026-09-14 on master and 2026-09-10 on release-2.3.
> Recent runs:
> * https://github.com/apache/flink/actions/runs/34798011374/job/103837976051
> master, testExceptionHistoryWithRestartableFailure
> * https://github.com/apache/flink/actions/runs/34427845031/job/102726173515
> release-2.3, testExceptionHistoryWithRestartableFailure
> * https://github.com/apache/flink/actions/runs/33866786819/job/101007980019
> testExceptionHistoryConcurrentRestart
> * https://github.com/apache/flink/actions/runs/33349433782/job/99360730245
> testJobStatusHookWithJobCanceled
> * https://github.com/apache/flink/actions/runs/32136151763/job/95710148170
> testExceptionHistoryWithGlobalFailOver
> * https://github.com/apache/flink/actions/runs/31662007213/job/94339220821
> testJobStatusHookWithJobFinished
> * https://github.com/apache/flink/actions/runs/30418270959/job/90470994165
> testStartCheckpointOnlyAfterVertexWithBlockingEdgeFinished
> Other failing methods: skipDeploymentIfVertexVersionOutdated,
> testDeploymentWaitForProducedPartitionRegistration,
> failGlobalWhenRestoringStateFails,
> jobStatusIsRestartingIfOneVertexIsWaitingForRestart,
> abortPendingCheckpointsWhenRestartingTasks.
> {code}
> [ERROR]
> org.apache.flink.runtime.scheduler.DefaultSchedulerTest.testJobStatusHookWithJobCanceled
> -- Time elapsed: 0.014 s <<< FAILURE!
> org.opentest4j.AssertionFailedError:
> expected: CANCELED
> but was: FAILED
> at
> org.apache.flink.runtime.scheduler.DefaultSchedulerTest.commonJobStatusHookTest(DefaultSchedulerTest.java:1933)
> at
> org.apache.flink.runtime.scheduler.DefaultSchedulerTest.testJobStatusHookWithJobCanceled(DefaultSchedulerTest.java:1818)
> {code}
> {code}
> [ERROR]
> org.apache.flink.runtime.scheduler.DefaultSchedulerTest.testStartCheckpointOnlyAfterVertexWithBlockingEdgeFinished
> -- Time elapsed: 0.026 s <<< ERROR!
> java.lang.IllegalStateException
> at
> org.apache.flink.util.Preconditions.checkState(Preconditions.java:177)
> at
> org.apache.flink.runtime.scheduler.DefaultSchedulerTest.transitionToRunning(DefaultSchedulerTest.java:2362)
> at
> org.apache.flink.runtime.scheduler.DefaultSchedulerTest.testStartCheckpointOnlyAfterVertexWithBlockingEdgeFinished(DefaultSchedulerTest.java:1877)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)