Source:
<code>public void testTaskManagerTimeoutDoesNotRemoveSlots() throws Exception { final Time taskManagerTimeout = Time.milliseconds(10L); final ResourceManagerId resourceManagerId = ResourceManagerId.generate(); final ResourceID resourceID = ResourceID.generate(); final CompletableFuture<InstanceID> releaseResourceFuture = new CompletableFuture<>(); final ResourceActions resourceActions = new TestingResourceActionsBuilder() .setReleaseResourceConsumer((instanceId, ignored) -> releaseResourceFuture.complete(instanceId)) .build(); final TaskExecutorGateway taskExecutorGateway = new TestingTaskExecutorGatewayBuilder().createTestingTaskExecutorGateway(); final TaskExecutorConnection taskExecutorConnection = new TaskExecutorConnection(resourceID, taskExecutorGateway); final SlotStatus slotStatus = createEmptySlotStatus(new SlotID(resourceID, 0), ResourceProfile.fromResources(1.0, 1)); final SlotReport initialSlotReport = new SlotReport(slotStatus); try (final SlotManager slotManager = createSlotManagerBuilder() .setTaskManagerTimeout(taskManagerTimeout) <START> .setRedundantSlotNum(0) <END> .buildAndStartWithDirectExec(resourceManagerId, resourceActions)) { slotManager.registerTaskManager(taskExecutorConnection, initialSlotReport); assertEquals(1, slotManager.getNumberRegisteredSlots()); assertThat(releaseResourceFuture.get(), is(taskExecutorConnection.getInstanceID())); assertEquals(1, slotManager.getNumberRegisteredSlots()); slotManager.unregisterTaskManager(taskExecutorConnection.getInstanceID(), TEST_EXCEPTION); assertEquals(0, slotManager.getNumberRegisteredSlots()); } }</code><technical_language>do need this? default 0</technical_language>

Target:
public void testTaskManagerTimeoutDoesNotRemoveSlots() throws Exception { final Time taskManagerTimeout = Time.milliseconds(10L); final ResourceManagerId resourceManagerId = ResourceManagerId.generate(); final ResourceID resourceID = ResourceID.generate(); final CompletableFuture<InstanceID> releaseResourceFuture = new CompletableFuture<>(); final ResourceActions resourceActions = new TestingResourceActionsBuilder() .setReleaseResourceConsumer((instanceId, ignored) -> releaseResourceFuture.complete(instanceId)) .build(); final TaskExecutorGateway taskExecutorGateway = new TestingTaskExecutorGatewayBuilder().createTestingTaskExecutorGateway(); final TaskExecutorConnection taskExecutorConnection = new TaskExecutorConnection(resourceID, taskExecutorGateway); final SlotStatus slotStatus = createEmptySlotStatus(new SlotID(resourceID, 0), ResourceProfile.fromResources(1.0, 1)); final SlotReport initialSlotReport = new SlotReport(slotStatus); try (final SlotManager slotManager = createSlotManagerBuilder() .setTaskManagerTimeout(taskManagerTimeout) .setRedundantTaskManagerNum(0) .buildAndStartWithDirectExec(resourceManagerId, resourceActions)) { slotManager.registerTaskManager(taskExecutorConnection, initialSlotReport); assertEquals(1, slotManager.getNumberRegisteredSlots()); assertThat(releaseResourceFuture.get(), is(taskExecutorConnection.getInstanceID())); assertEquals(1, slotManager.getNumberRegisteredSlots()); slotManager.unregisterTaskManager(taskExecutorConnection.getInstanceID(), TEST_EXCEPTION); assertEquals(0, slotManager.getNumberRegisteredSlots()); } }