[
https://issues.apache.org/jira/browse/FLINK-7102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16087248#comment-16087248
]
ASF GitHub Bot commented on FLINK-7102:
---------------------------------------
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 )
> improve ClassLoaderITCase
> -------------------------
>
> Key: FLINK-7102
> URL: https://issues.apache.org/jira/browse/FLINK-7102
> Project: Flink
> Issue Type: Bug
> Components: Tests
> Affects Versions: 1.4.0
> Reporter: Nico Kruber
> Assignee: Nico Kruber
>
> {{ClassLoaderITCase}}...
> * unnecessarily runs multiple tests in a single test case
> * {{#testDisposeSavepointWithCustomKvState()}} does not cancel its job (thus
> the order of execution of test cases defines the outcome)
> * uses {{e.getCause().getCause()}} which may cause {{NullPointerException}}s
> hiding the original error
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)