StephanEwen commented on a change in pull request #9058: [FLINK-13166] Add
support for batch slot requests to SlotPoolImpl
URL: https://github.com/apache/flink/pull/9058#discussion_r302450229
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolPendingRequestFailureTest.java
##########
@@ -127,13 +133,50 @@ public void
testFailingResourceManagerRequestFailsPendingSlotRequestAndCancelsRM
}
}
+ /**
+ * Tests that a pending slot request is failed with a timeout.
+ */
+ @Test
+ public void testPendingSlotRequestTimeout() throws Exception {
+ final ScheduledExecutorService singleThreadExecutor =
Executors.newSingleThreadScheduledExecutor();
+ final ComponentMainThreadExecutor componentMainThreadExecutor =
ComponentMainThreadExecutorServiceAdapter.forSingleThreadExecutor(singleThreadExecutor);
+
+ final SlotPoolImpl slotPool =
setUpSlotPool(componentMainThreadExecutor);
+
+ try {
+ final Time timeout = Time.milliseconds(5L);
+
+ final CompletableFuture<PhysicalSlot> slotFuture =
CompletableFuture
+ .supplyAsync(() ->
requestNewAllocatedSlot(slotPool, new SlotRequestId(), timeout),
componentMainThreadExecutor)
+ .thenCompose(Function.identity());
+
+ try {
+ slotFuture.get();
+ fail("Expected TimeoutFuture.");
Review comment:
That error message seems a bit off.
----------------------------------------------------------------
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]
With regards,
Apache Git Services