This is an automated email from the ASF dual-hosted git repository.
RocMarshal 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 ef4d88e2e50 [FLINK-39902][tests] Fix race in
RescaleTimelineITCase.testRescaleTerminatedByJobFinished (#28378)
ef4d88e2e50 is described below
commit ef4d88e2e50577d98a13fa405c41c2cf4b386286
Author: Martijn Visser <[email protected]>
AuthorDate: Sat Jun 13 09:04:40 2026 +0200
[FLINK-39902][tests] Fix race in
RescaleTimelineITCase.testRescaleTerminatedByJobFinished (#28378)
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)
---
.../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);