pnowojski commented on a change in pull request #13351: URL: https://github.com/apache/flink/pull/13351#discussion_r499760494
########## File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/StreamTaskMultipleInputSelectiveReadingTest.java ########## @@ -197,22 +198,21 @@ public void testInputStarvation() throws Exception { testHarness.processElement(new StreamRecord<>("3"), 1); testHarness.processElement(new StreamRecord<>("4"), 1); - testHarness.processSingleStep(); expectedOutput.add(new StreamRecord<>("[2]: 1")); - testHarness.processSingleStep(); expectedOutput.add(new StreamRecord<>("[2]: 2")); - assertThat(testHarness.getOutput(), contains(expectedOutput.toArray())); + testHarness.processAll(); + assertEquals(expectedOutput, new ArrayList<>(testHarness.getOutput()).subList(0, expectedOutput.size())); Review comment: Hmmm, maybe replace it with more reliable condition, sth like: ``` boolean noElementFromInputGate3 = true; steps = 0; while (noElementFromInputGate3 && steps++ < 100 && testHarness.procesSingleStep()) { noElementFromInputGate3 = ... // check for presence of `new StreamRecord<>("[3]: 1"))` } ``` ? ---------------------------------------------------------------- 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