gyfora commented on code in PR #648:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/648#discussion_r1290964118
##########
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:
These tests you added don't actually cover that draining was used (the
proper client method was called).
I suggest removing what you added and replacing with 2 tests in the
`AbstractFlinkServiceTests` there you can test the changed service methods
directly and make sure that the Flink client is called with the proper argument.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]