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

XComp 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 7f770b87178 [FLINK-40076][tests] Fix race in 
RescaleTimelineITCase.testRecordNonTerminatedRescaleMergingWithNewRecoverableFailureTriggerCause
7f770b87178 is described below

commit 7f770b87178b66781708b92beb3540e5257c7c9f
Author: Martijn Visser <[email protected]>
AuthorDate: Sun Jul 5 19:59:52 2026 +0200

    [FLINK-40076][tests] Fix race in 
RescaleTimelineITCase.testRecordNonTerminatedRescaleMergingWithNewRecoverableFailureTriggerCause
    
    After terminating a TaskManager to trigger a recoverable failover, the test
    waited via waitForVertexParallelismReachedAndJobRunning for PARALLELISM. 
That
    condition is already satisfied by the stale pre-failover state, so the wait
    returns immediately without synchronizing with the failover. The snapshot 
could
    therefore be taken before AdaptiveScheduler merged the failover into the
    in-progress UPDATE_REQUIREMENT rescale and re-stamped its trigger cause, 
letting
    the test observe UPDATE_REQUIREMENT instead of the expected 
RECOVERABLE_FAILOVER.
    
    Wait for the job to be RUNNING again at the parallelism the single remaining
    TaskManager can host (NUMBER_SLOTS_PER_TASK_MANAGER) instead. The merge
    re-stamps the trigger cause in goToRestarting, before the job runs again at 
that
    reduced parallelism, so the job coming back up synchronizes the snapshot 
with
    the merge. The assertion is unchanged.
    
    Generated-by: Claude Opus 4.8 (via Claude Code)
---
 .../runtime/scheduler/adaptive/timeline/RescaleTimelineITCase.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/timeline/RescaleTimelineITCase.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/timeline/RescaleTimelineITCase.java
index a25d0c97223..96328abf426 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/timeline/RescaleTimelineITCase.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/timeline/RescaleTimelineITCase.java
@@ -567,7 +567,11 @@ class RescaleTimelineITCase {
 
         miniCluster.terminateTaskManager(0);
 
-        waitForVertexParallelismReachedAndJobRunning(jobGraph, JOB_VERTEX_ID, 
PARALLELISM);
+        // Wait for the failover to complete before snapshotting: the merge 
that re-stamps the
+        // trigger cause to RECOVERABLE_FAILOVER runs before the job is 
RUNNING again at the
+        // reduced parallelism (one TaskManager left).
+        waitForVertexParallelismReachedAndJobRunning(
+                jobGraph, JOB_VERTEX_ID, NUMBER_SLOTS_PER_TASK_MANAGER);
 
         final ExecutionGraphInfo executionGraphInfo =
                 miniCluster.getExecutionGraphInfo(jobGraph.getJobID()).join();

Reply via email to