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

    https://github.com/apache/flink/pull/4255#discussion_r127444872
  
    --- Diff: 
flink-tests/src/test/java/org/apache/flink/test/classloading/ClassLoaderITCase.java
 ---
    @@ -137,6 +137,20 @@ public void testJobsWithCustomClassLoader() throws 
IOException, ProgramInvocatio
     
                        inputSplitTestProg.invokeInteractiveModeForExecution();
     
    +           } catch (Exception e) {
    +                   if (!(e.getCause() != null &&
    --- End diff --
    
    please at least wrap this `if` statement into a function 
`swallowScuessException(e)` or something like that.
    
    Another idea is to maybe use this pattern:
    ```
        @Rule
        public ExpectedException expectedException = ExpectedException.none();
    
        @Test
        public void test() {
                expectedException.expectCause(isA(SuccessException.class));
                somethingThatThrows();
        }
    ```
    ( https://stackoverflow.com/a/20759785/8149051 )


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to