KarmaGYZ commented on a change in pull request #11248: [FLINK-16299] Release containers recovered from previous attempt in w… URL: https://github.com/apache/flink/pull/11248#discussion_r385533680
########## File path: flink-yarn/src/test/java/org/apache/flink/yarn/YarnResourceManagerTest.java ########## @@ -176,9 +179,37 @@ public void teardown() throws Exception { } } + static class TestingNMClientAsync extends NMClientAsync { + + public List<ContainerStatus> containerStatuses = new ArrayList<>(); + + protected TestingNMClientAsync(CallbackHandler callbackHandler) { + super(callbackHandler); + } + + @Override + public void startContainerAsync(Container container, ContainerLaunchContext containerLaunchContext) { + // Do nothing. + } + + @Override + public void stopContainerAsync(ContainerId containerId, NodeId nodeId) { + // Do nothing. + } + + @Override + public void getContainerStatusAsync(ContainerId containerId, NodeId nodeId) { + for (ContainerStatus containerStatus: containerStatuses) { + if (containerStatus.getContainerId().equals(containerId)) { + callbackHandler.onContainerStatusReceived(containerId, containerStatus); + } + } + } + } Review comment: Good point! ---------------------------------------------------------------- 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 With regards, Apache Git Services