From 3ecd0a1041c21f151dc43d06610368646ff8370c Mon Sep 17 00:00:00 2001 From: Dawid Wysakowicz Date: Tue, 12 Apr 2022 17:17:40 +0200 Subject: [PATCH] [FLINK-26977] Unify SavepointITCase#testStopWithSavepointFailingAfterSnapshotCreation for both schedulers This closes #19439 --- .../test/checkpointing/SavepointITCase.java | 46 +++---------------- 1 file changed, 6 insertions(+), 40 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 5ebd7ec334871c..fa0f155bba7cd6 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 @@ -1026,22 +1026,12 @@ public void testStopWithSavepointFailingAfterSnapshotCreation() throws Exception // 2. job failover triggered by SchedulerBase.stopWithSavepoint 0, (jobId, actualException) -> { - if (ClusterOptions.isAdaptiveSchedulerEnabled(new Configuration())) { - return actualException - .getMessage() - .contains("Stop with savepoint operation could not be completed"); - } else { - Optional actualFlinkException = - findThrowable( - actualException, StopWithSavepointStoppingException.class); - return actualFlinkException - .map( - e -> - e.getMessage() - .startsWith( - "A savepoint has been created at:")) - .orElse(false); - } + Optional actualFlinkException = + findThrowable( + actualException, StopWithSavepointStoppingException.class); + return actualFlinkException + .map(e -> e.getMessage().startsWith("A savepoint has been created at:")) + .orElse(false); }, false); } @@ -1096,30 +1086,6 @@ public void testStopWithSavepointWithDrainGlobalFailoverIfSavepointAborted() thr } } - private static BiFunction - assertAfterSnapshotCreationFailure() { - return (jobId, actualException) -> { - if (ClusterOptions.isAdaptiveSchedulerEnabled(new Configuration())) { - return actualException - .getMessage() - .contains("Stop with savepoint operation could not be completed"); - } else { - Optional actualFlinkException = - findThrowable(actualException, FlinkException.class); - if (!actualFlinkException.isPresent()) { - return false; - } - return actualFlinkException - .get() - .getMessage() - .contains( - String.format( - "A global fail-over is triggered to recover the job %s.", - jobId)); - } - }; - } - private static BiFunction assertInSnapshotCreationFailure() { return (ignored, actualException) -> {