zentol commented on code in PR #20811:
URL: https://github.com/apache/flink/pull/20811#discussion_r968216848
##########
flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/DefaultJobManagerRunnerRegistryTest.java:
##########
@@ -200,14 +197,36 @@ public void testFailingLocalCleanupAsync() throws
Exception {
.failsWithin(Duration.ZERO)
.withThrowableOfType(ExecutionException.class)
.extracting(FlinkAssertions::chainOfCauses,
FlinkAssertions.STREAM_THROWABLE)
- .hasExactlyElementsOfTypes(
- ExecutionException.class,
- FlinkException.class,
- expectedException.getClass())
+ .hasExactlyElementsOfTypes(ExecutionException.class,
expectedException.getClass())
.last()
.isEqualTo(expectedException);
}
+ @Test
+ public void testLocalCleanupAsyncNonBlocking() {
+ final TestingJobManagerRunner jobManagerRunner =
+
TestingJobManagerRunner.newBuilder().setBlockingTermination(true).build();
+ testInstance.register(jobManagerRunner);
+
+ // this call would block
+ final CompletableFuture<Void> cleanupFuture =
+ Assertions.assertTimeoutPreemptively(
+ Duration.ofMinutes(10),
+ () ->
+ testInstance.localCleanupAsync(
+ jobManagerRunner.getJobID(),
+
java.util.concurrent.Executors.newSingleThreadExecutor()),
Review Comment:
hmm, I'd rather use some executor here that does not consume resources
(because this thread will pollute thread dumps on CI). I thought about a
DirectExecutor (its unused anyway so :shrug:), so maybe some kind of
FailingExecutor that rejects everything.
--
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]