tillrohrmann commented on a change in pull request #15799:
URL: https://github.com/apache/flink/pull/15799#discussion_r624979849
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/DispatcherTest.java
##########
@@ -685,16 +684,16 @@ public void testJobSuspensionWhenDispatcherIsTerminated()
throws Exception {
assertThat(jobResultFuture.isDone(), is(false));
- dispatcher.closeAsync();
+ dispatcher.close();
- try {
- jobResultFuture.get();
- fail("Expected the job result to throw an exception.");
- } catch (ExecutionException ee) {
- assertThat(
- ExceptionUtils.findThrowable(ee,
JobNotFinishedException.class).isPresent(),
- is(true));
- }
+ final JobResult jobResult = jobResultFuture.get();
+ assertEquals(jobResult.getApplicationStatus(),
ApplicationStatus.UNKNOWN);
+
+ // Ensure that the suspended execution graph is accessible during
shutdown
+ final ExecutionGraphInfo executionGraphInfo =
+ dispatcher.requestExecutionGraphInfo(jobId, TIMEOUT).get();
Review comment:
Directly accessing the `dispatcher` is actually not recommended. One
should always use the `DispatcherGateway`. If you use this gateway, then you
wouldn't get an answer back because `dispatcher.close()` waits until the
`dispatcher` has been terminated.
If you want to test that one receives a suspended EG during shut down, I
would suggest to have two jobs. One job which takes longer for termination. The
other one should in the meantime return SUSPENDED when calling
`dispatcherGateway.requestJobResult()`.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]