zhuzhurk commented on a change in pull request #13181:
URL: https://github.com/apache/flink/pull/13181#discussion_r484629816
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/SharedSlotTest.java
##########
@@ -234,6 +236,45 @@ public void testReleaseIfPhysicalSlotIsAllocated() {
assertThat(released.isDone(), is(true));
}
+ @Test
+ public void tesDuplicatedReturnLogicalSlotFails() {
+ CompletableFuture<PhysicalSlot> slotContextFuture =
CompletableFuture
+ .completedFuture(new TestingPhysicalSlot(RP, new
AllocationID()));
+ AtomicInteger released = new AtomicInteger(0);
+ SharedSlot sharedSlot = SharedSlotBuilder
+ .newBuilder()
+ .withSlotContextFuture(slotContextFuture)
+ .withReleaseCallback(g -> released.incrementAndGet())
Review comment:
How about adding a case which will invoke `SharedSlot#release()` in the
release callback?
This can happen in production code path.
----------------------------------------------------------------
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]