tillrohrmann commented on a change in pull request #13641: URL: https://github.com/apache/flink/pull/13641#discussion_r543322114
########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ExecutionTest.java ########## @@ -82,202 +82,12 @@ private final TestingComponentMainThreadExecutor testMainThreadUtil = EXECUTOR_RESOURCE.getComponentMainThreadTestExecutor(); - /** - * Tests that slots are released if we cannot assign the allocated resource to the - * Execution. - */ - @Test - public void testSlotReleaseOnFailedResourceAssignment() throws Exception { - final JobVertex jobVertex = createNoOpJobVertex(); - final JobVertexID jobVertexId = jobVertex.getID(); - - final CompletableFuture<LogicalSlot> slotFuture = new CompletableFuture<>(); - final ProgrammedSlotProvider slotProvider = new ProgrammedSlotProvider(1); - slotProvider.addSlot(jobVertexId, 0, slotFuture); - - ExecutionGraph executionGraph = ExecutionGraphTestUtils.createSimpleTestGraph( - slotProvider, - new NoRestartStrategy(), - jobVertex); - - executionGraph.start(ComponentMainThreadExecutorServiceAdapter.forMainThread()); - - ExecutionJobVertex executionJobVertex = executionGraph.getJobVertex(jobVertexId); - - final Execution execution = executionJobVertex.getTaskVertices()[0].getCurrentExecutionAttempt(); - - final SingleSlotTestingSlotOwner slotOwner = new SingleSlotTestingSlotOwner(); - - final LogicalSlot slot = createTestingLogicalSlot(slotOwner); - - final LogicalSlot otherSlot = new TestingLogicalSlotBuilder().createTestingLogicalSlot(); - - CompletableFuture<Execution> allocationFuture = execution.allocateResourcesForExecution( - executionGraph.getSlotProviderStrategy(), - LocationPreferenceConstraint.ALL, - Collections.emptySet()); - - assertFalse(allocationFuture.isDone()); - - assertEquals(ExecutionState.SCHEDULED, execution.getState()); - - // assign a different resource to the execution - assertTrue(execution.tryAssignResource(otherSlot)); - - // completing now the future should cause the slot to be released - slotFuture.complete(slot); - - assertEquals(slot, slotOwner.getReturnedSlotFuture().get()); - } - private TestingLogicalSlot createTestingLogicalSlot(SlotOwner slotOwner) { return new TestingLogicalSlotBuilder() .setSlotOwner(slotOwner) .createTestingLogicalSlot(); } - /** - * Tests that the slot is released in case of a execution cancellation when having - * a slot assigned and being in state SCHEDULED. - */ - @Test - public void testSlotReleaseOnExecutionCancellationInScheduled() throws Exception { Review comment: I think you are right @zhuzhurk. Thanks a lot for the information. ---------------------------------------------------------------- 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: us...@infra.apache.org