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 c3ec5690874 [FLINK-39845][tests] Fix 
SavepointITCase.testStopWithSavepointFailsOverToSavepoint under 
AdaptiveScheduler
c3ec5690874 is described below

commit c3ec5690874a55110ef3ecfb80a335c415ee1b57
Author: Martijn Visser <[email protected]>
AuthorDate: Thu Jun 4 11:06:38 2026 +0200

    [FLINK-39845][tests] Fix 
SavepointITCase.testStopWithSavepointFailsOverToSavepoint under 
AdaptiveScheduler
    
    The JUnit5 migration (FLINK-39124, #27667) replaced a cause-chain search 
(ExceptionUtils.assertThrowable -> findThrowable) with a direct-cause assertion 
(assertThatThrownBy(...).hasCauseInstanceOf(StopWithSavepointStoppingException.class)).
 Under the AdaptiveScheduler, StopWithSavepoint.onLeave() wraps the expected 
StopWithSavepointStoppingException inside a FlinkException ("Stop with 
savepoint operation could not be completed."), so it is no longer the direct 
cause. This regressed th [...]
    
    Restore the chain search via FlinkAssertions.anyCauseMatches so the test 
passes under both the default and adaptive schedulers, matching the 
pre-migration behavior still present on release-2.1.
    
    Generated-by: Claude Code (Claude Opus 4.8)
---
 .../org/apache/flink/test/checkpointing/SavepointITCase.java   | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/flink-tests/src/test/java/org/apache/flink/test/checkpointing/SavepointITCase.java
 
b/flink-tests/src/test/java/org/apache/flink/test/checkpointing/SavepointITCase.java
index 3b321352519..d4aa0386768 100644
--- 
a/flink-tests/src/test/java/org/apache/flink/test/checkpointing/SavepointITCase.java
+++ 
b/flink-tests/src/test/java/org/apache/flink/test/checkpointing/SavepointITCase.java
@@ -132,6 +132,7 @@ import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 import static java.util.concurrent.CompletableFuture.allOf;
+import static org.apache.flink.core.testutils.FlinkAssertions.anyCauseMatches;
 import static 
org.apache.flink.runtime.testutils.CommonTestUtils.waitForAllTaskRunning;
 import static org.apache.flink.test.util.TestUtils.submitJobAndWaitForResult;
 import static org.apache.flink.test.util.TestUtils.waitUntilAllTasksAreRunning;
@@ -321,11 +322,14 @@ class SavepointITCase {
                             savepointDir.getAbsolutePath(),
                             SavepointFormatType.CANONICAL);
 
+            // The AdaptiveScheduler wraps StopWithSavepointStoppingException 
in a FlinkException,
+            // so search the whole cause chain rather than only the direct 
cause.
             assertThatThrownBy(savepointCompleted::get)
                     .isInstanceOf(ExecutionException.class)
-                    
.hasCauseInstanceOf(StopWithSavepointStoppingException.class)
-                    .cause()
-                    .hasMessageStartingWith("A savepoint has been created at: 
");
+                    .satisfies(
+                            anyCauseMatches(
+                                    StopWithSavepointStoppingException.class,
+                                    "A savepoint has been created at: "));
             assertThat(client.getJobStatus(jobGraph.getJobID()).get())
                     .isIn(JobStatus.FAILED, JobStatus.FAILING);
         } finally {

Reply via email to