Github user pnowojski commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6091#discussion_r191767070
  
    --- Diff: 
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/operators/async/AsyncWaitOperatorTest.java
 ---
    @@ -648,6 +662,52 @@ public void testAsyncTimeout() throws Exception {
                
ExceptionUtils.findThrowable(mockEnvironment.getActualExternalFailureCause().get(),
 TimeoutException.class);
        }
     
    +   @Test
    +   public void testAsyncTimeoutAware() throws Exception {
    --- End diff --
    
    Please deduplicate the code of this method with `testAsyncTimeout()` to sth 
like that:
    
    ```
    @Test
    public void testAsyncTimeoutFailure() throws Exception {
        testAsyncTimeout(
                new LazyAsyncFunction()
                Optional.of(TimeoutException.class),
                new StreamRecord<>(2, 5L));
    }
    
    public void testAsyncTimeoutIgnore() throws Exception {
        testAsyncTimeout(
                new IgnoreTimeoutLazyAsyncFunction()
                Optional.of(TimeoutException.class),
                new StreamRecord<>(6, 0L),
                new StreamRecord<>(4, 5L));
    }
    
    private void testAsyncTimeout(
                Optional<Class<?>> expectedException,
                StreamRecord<Integer>... expectedRecords) throws Exception {
        // your current testAsyncTimeoutAware method body adjusted to above 
parameters
    }
    ```
    
    or sth similar.


---

Reply via email to