nicoweidner commented on a change in pull request #18067:
URL: https://github.com/apache/flink/pull/18067#discussion_r767871750



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/DispatcherTest.java
##########
@@ -447,6 +447,46 @@ public void 
testCancellationOfNonCanceledTerminalJobFailsWithAppropriateExceptio
                         FlinkJobTerminatedWithoutCancellationException.class, 
Duration.ofHours(8)));
     }
 
+    @Test
+    public void testNoHistoryServerArchiveCreatedForSuspendedJob() throws 
Exception {
+        final CompletableFuture<Void> archiveAttemptFuture = new 
CompletableFuture<>();
+        final CompletableFuture<JobManagerRunnerResult> jobTerminationFuture =
+                new CompletableFuture<>();
+        dispatcher =
+                new TestingDispatcherBuilder()
+                        .setJobManagerRunnerFactory(
+                                new FinishingJobManagerRunnerFactory(
+                                        jobTerminationFuture, () -> {}))
+                        .setHistoryServerArchivist(
+                                executionGraphInfo -> {
+                                    archiveAttemptFuture.complete(null);
+                                    return 
CompletableFuture.completedFuture(null);
+                                })
+                        .build();
+        dispatcher.start();
+        jobMasterLeaderElectionService.isLeader(UUID.randomUUID());
+        DispatcherGateway dispatcherGateway = 
dispatcher.getSelfGateway(DispatcherGateway.class);
+
+        JobID jobId = jobGraph.getJobID();
+
+        dispatcherGateway.submitJob(jobGraph, TIMEOUT).get();
+        jobTerminationFuture.complete(
+                JobManagerRunnerResult.forSuccess(
+                        new ExecutionGraphInfo(
+                                new ArchivedExecutionGraphBuilder()
+                                        .setJobID(jobId)
+                                        .setState(JobStatus.SUSPENDED)
+                                        .build())));
+
+        // wait for job to finish
+        dispatcherGateway.requestJobResult(jobId, TIMEOUT).get();
+        // sanity check
+        assertThat(

Review comment:
       nit: After reading this thread, I thought AssertJ was somewhat preferred 
for new tests (it might be a bit of a stretch to read a "recommendation" into 
this thread, though)?
   https://lists.apache.org/thread/ptc12x4sw3tcj0h0oz2gsrtpq9m6djz7




-- 
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]


Reply via email to