Aitozi commented on a change in pull request #85:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/85#discussion_r830599461
##########
File path:
flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/reconciler/JobReconcilerTest.java
##########
@@ -199,6 +200,38 @@ public void triggerSavepoint() throws Exception {
assertNull(spDeployment.getStatus().getJobStatus().getSavepointInfo().getTriggerId());
}
+ @Test
+ public void triggerRestart() throws Exception {
+ Context context =
TestUtils.createContextWithReadyJobManagerDeployment();
+ TestingFlinkService flinkService = new TestingFlinkService();
+
+ JobReconciler reconciler = new JobReconciler(null, flinkService,
operatorConfiguration);
+ FlinkDeployment deployment = TestUtils.buildApplicationCluster();
+ Configuration config = FlinkUtils.getEffectiveConfig(deployment, new
Configuration());
+
+ reconciler.reconcile(deployment, context, config);
+ List<Tuple2<String, JobStatusMessage>> runningJobs =
flinkService.listJobs();
+ verifyAndSetRunningJobsToStatus(deployment, runningJobs);
+ long jobStartTime = runningJobs.get(0).f1.getStartTime();
+
+ // Test restart job
+ FlinkDeployment restartJob = ReconciliationUtils.clone(deployment);
+ restartJob.getSpec().setRestartNonce(1L);
+ reconciler.reconcile(restartJob, context, config);
+
+ runningJobs = flinkService.listJobs();
+ assertEquals(1, runningJobs.size());
+ long newJobStartTime = runningJobs.get(0).f1.getStartTime();
+ Assertions.assertTrue(newJobStartTime > jobStartTime);
Review comment:
Good catch, removed.
--
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]