tillrohrmann commented on a change in pull request #7568: [FLINK-11417] Make
access to ExecutionGraph single threaded from JobMaster main thread
URL: https://github.com/apache/flink/pull/7568#discussion_r252296298
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/slotpool/SingleLogicalSlotTest.java
##########
@@ -109,6 +109,23 @@ public void testPayloadAssignmentAfterRelease() {
assertThat(singleLogicalSlot.tryAssignPayload(dummyPayload),
is(false));
}
+ @Test
+ public void testReleaseOnlyHappensAfterReturningSlotCompleted() {
+
+ final SingleLogicalSlot singleLogicalSlot =
createSingleLogicalSlot(new DummySlotOwner() {
+ @Override
+ public CompletableFuture<Boolean>
returnAllocatedSlot(LogicalSlot logicalSlot) {
+ // we return a future that will never complete
instead
+ return new CompletableFuture<>();
+ }
+ });
+
+ CompletableFuture<?> releaseFuture =
singleLogicalSlot.releaseSlot(new FlinkException("Test exception"));
+
+ // this must not be done, because the future that signals a
successful return never completed.
+ assertThat(releaseFuture.isDone(), is(false));
Review comment:
It would be good to also test that if we now complete the
`returnAllocatedSlot` future that the `releaseFuture` will also be completed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services