You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "mananmangal (via GitHub)" <gi...@apache.org> on 2023/08/11 17:37:44 UTC

[GitHub] [flink-kubernetes-operator] mananmangal commented on a diff in pull request #648: [FLINK-32700] Support job drain for Savepoint upgrade mode

mananmangal commented on code in PR #648:
URL: https://github.com/apache/flink-kubernetes-operator/pull/648#discussion_r1291624743


##########
flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/reconciler/deployment/ApplicationReconcilerTest.java:
##########
@@ -1070,4 +1070,33 @@ public void testUpgradeReconciledGeneration() throws Exception {
                         .getMetadata()
                         .getGeneration());
     }
+
+    @ParameterizedTest
+    @MethodSource("org.apache.flink.kubernetes.operator.TestUtils#flinkVersions")
+    public void testSubmitAndDrainOnCleanUpWithSavepoint(FlinkVersion flinkVersion)
+            throws Exception {
+        var conf = configManager.getDefaultConfig();
+        conf.set(KubernetesOperatorConfigOptions.SAVEPOINT_ON_DELETION, true);
+        conf.set(KubernetesOperatorConfigOptions.DRAIN_ON_SAVEPOINT_DELETION, true);
+        configManager.updateDefaultConfig(conf);
+
+        FlinkDeployment deployment = TestUtils.buildApplicationCluster(flinkVersion);
+
+        // session ready
+        reconciler.reconcile(deployment, TestUtils.createContextWithReadyFlinkDeployment());
+        verifyAndSetRunningJobsToStatus(deployment, flinkService.listJobs());
+
+        // clean up
+        assertEquals(
+                null, deployment.getStatus().getJobStatus().getSavepointInfo().getLastSavepoint());
+        reconciler.cleanup(deployment, TestUtils.createContextWithReadyFlinkDeployment());
+        assertEquals(
+                "savepoint_0",
+                deployment
+                        .getStatus()
+                        .getJobStatus()
+                        .getSavepointInfo()
+                        .getLastSavepoint()
+                        .getLocation());
+    }

Review Comment:
   I understand, I will make these changes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org