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

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


The following commit(s) were added to refs/heads/release-2.3 by this push:
     new b64a9f25bf5 [FLINK-39902][tests] Fix race in 
RescaleTimelineITCase.testRescaleTerminatedByJobFinished (#28378) (#28413)
b64a9f25bf5 is described below

commit b64a9f25bf503086a948acf70e46bc2f168c0ee8
Author: Yuepeng Pan <[email protected]>
AuthorDate: Sun Jun 14 01:34:39 2026 +0800

    [FLINK-39902][tests] Fix race in 
RescaleTimelineITCase.testRescaleTerminatedByJobFinished (#28378) (#28413)
    
    Unblocking the task raced with the scheduler recording the second rescale; 
on
    a slow machine the job finished first, leaving the history at size 1 and
    timing out the wait. Wait for the rescale to be recorded before unblocking.
    
    The assumeThat(enabledRescaleHistory) check had to move before the update 
RPC
    because the new size-2 history wait is only meaningful when rescale history 
is
    enabled; for the disabled parameter the history never grows and the wait 
would
    hang.
    
    Generated-by: Claude Opus 4.8 (1M context)
    (cherry picked from commit ef4d88e2e50577d98a13fa405c41c2cf4b386286)
    
    Co-authored-by: Martijn Visser 
<[email protected]>
---
 .../scheduler/adaptive/timeline/RescaleTimelineITCase.java     | 10 +++++++++-
 1 file changed, 9 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 fd12bc5de7f..2a04d302428 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
@@ -276,11 +276,19 @@ class RescaleTimelineITCase {
 
         waitForVertexParallelismReachedAndJobRunning(jobGraph, JOB_VERTEX_ID, 
PARALLELISM);
 
+        assumeThat(enabledRescaleHistory(configuration)).isTrue();
+
         updateJobResourceRequirements(miniCluster, jobGraph, 1, PARALLELISM * 
2);
 
+        // The upper bound (PARALLELISM * 2) exceeds the available slots, so 
this rescale is only
+        // recorded in the history without changing the parallelism. Wait 
until it is recorded
+        // before unblocking, otherwise on a slow machine the task can finish 
first and the size-2
+        // condition below times out.
+        waitUntilConditionWithTimeout(
+                () -> getRescaleHistory(miniCluster, jobGraph).size() == 2, 
10000);
+
         OnceBlockingNoOpInvokable.unblock();
 
-        assumeThat(enabledRescaleHistory(configuration)).isTrue();
         waitUntilConditionWithTimeout(
                 () -> {
                     List<Rescale> rescaleHistory = 
getRescaleHistory(miniCluster, jobGraph);

Reply via email to