You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by NicoK <gi...@git.apache.org> on 2017/07/04 15:56:21 UTC

[GitHub] flink pull request #4255: [FLINK-7102] improve ClassLoaderITCase

GitHub user NicoK opened a pull request:

    https://github.com/apache/flink/pull/4255

    [FLINK-7102] improve ClassLoaderITCase

    * ClassLoaderITCase unnecessarily runs multiple tests in a single test case
    * ClassLoaderITCase#testDisposeSavepointWithCustomKvState() does not cancel its
      job (thus the order of execution of test cases defines the outcome)
    * ClassLoaderITCase uses e.getCause().getCause() which may cause
      {{NullPointerException}}s hiding the original error

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/NicoK/flink flink-7102

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/4255.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4255
    
----
commit 87f28e5d972d33c82f44c05ab62743cb614e5239
Author: Nico Kruber <ni...@data-artisans.com>
Date:   2017-07-04T11:49:55Z

    [FLINK-7102] improve ClassLoaderITCase
    
    * ClassLoaderITCase unnecessarily runs multiple tests in a single test case
    * ClassLoaderITCase#testDisposeSavepointWithCustomKvState() does not cancel its
      job (thus the order of execution of test cases defines the outcome)
    * ClassLoaderITCase uses e.getCause().getCause() which may cause
      {{NullPointerException}}s hiding the original error

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #4255: [FLINK-7102] improve ClassLoaderITCase

Posted by pnowojski <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #4255: [FLINK-7102] improve ClassLoaderITCase

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/4255


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #4255: [FLINK-7102] improve ClassLoaderITCase

Posted by pnowojski <gi...@git.apache.org>.
Github user pnowojski commented on the issue:

    https://github.com/apache/flink/pull/4255
  
    ok, I missed that you didn't fail if the expected exception didn't happen :) Now it's LGTM


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #4255: [FLINK-7102] improve ClassLoaderITCase

Posted by NicoK <gi...@git.apache.org>.
Github user NicoK commented on the issue:

    https://github.com/apache/flink/pull/4255
  
    ...that's how wrong the original implementation was - let me add this to the description of the PR


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #4255: [FLINK-7102] improve ClassLoaderITCase

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:

    https://github.com/apache/flink/pull/4255
  
    merging.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #4255: [FLINK-7102] improve ClassLoaderITCase

Posted by NicoK <gi...@git.apache.org>.
Github user NicoK commented on the issue:

    https://github.com/apache/flink/pull/4255
  
    you're right - wasn't looking thoroughly enough (and only recently learned about `ExpectedException`).
    
    Additionally, I found out that this ignored exception was actually required to be thrown for some of these tests while others didn't even throw it. So with the newest changes (also rebased on top of the current `master`), the tests actually better reflect the intended behaviour.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---