pnowojski commented on a change in pull request #18475: URL: https://github.com/apache/flink/pull/18475#discussion_r792408057
########## File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/MultipleInputStreamTaskTest.java ########## @@ -101,10 +101,15 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.junit.jupiter.api.Assertions; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; +import org.mockito.Mockito; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.rule.PowerMockRule; Review comment: That is part of the reason why we generally speaking do not accept new test code using mockito, as tests shouldn't relay on private implementation details of the production code. ########## File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/StreamMultipleInputProcessor.java ########## @@ -55,17 +77,24 @@ public StreamMultipleInputProcessor( || inputSelectionHandler.areAllInputsFinished()) { return AVAILABLE; } - final CompletableFuture<?> anyInputAvailable = new CompletableFuture<>(); for (int i = 0; i < inputProcessors.length; i++) { if (!inputSelectionHandler.isInputFinished(i) - && inputSelectionHandler.isInputSelected(i)) { - assertNoException( - inputProcessors[i] - .getAvailableFuture() - .thenRun(() -> anyInputAvailable.complete(null))); + && inputSelectionHandler.isInputSelected(i) + && inputProcessors[i].getAvailableFuture() == AVAILABLE) { + return AVAILABLE; Review comment: But 1. in what scenario is this extra short cut doing something more compared to the old check? 2. if there is such scenario, have you tested that it's worth the added complexity? -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org