[ 
https://issues.apache.org/jira/browse/FLINK-2399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14713068#comment-14713068
 ] 

ASF GitHub Bot commented on FLINK-2399:
---------------------------------------

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

    https://github.com/apache/flink/pull/945#discussion_r37977899
  
    --- Diff: 
flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobSubmitTest.java
 ---
    @@ -170,4 +170,43 @@ public void initializeOnMaster(ClassLoader loader) 
throws Exception {
                        fail(e.getMessage());
                }
        }
    +
    +   /**
    +    * Verifies failure when the client and job manager versions mismatch
    +    */
    +   @Test
    +   public void testFailureClientJobManagerVersionMismatch() {
    +           try {
    +                   // create a simple job graph
    +
    +                   JobVertex jobVertex = new JobVertex("Vertex that fails 
in initializeOnMaster") {
    +
    +                           @Override
    +                           public void initializeOnMaster(ClassLoader 
loader) throws Exception {
    +                                   throw new RuntimeException("test 
exception");
    +                           }
    +                   };
    +
    +                   jobVertex.setInvokableClass(Tasks.NoOpInvokable.class);
    +                   JobGraph jg = new JobGraph("test job", jobVertex);
    +
    +                   // submit the job
    +                   Future<Object> submitFuture = jobManager.ask(new 
JobManagerMessages.SubmitJob(jg, false, "RANDOM_CLIENT_VERSION"), timeout);
    +                   try {
    +                           Await.result(submitFuture, timeout);
    +                   }
    +                   catch (JobExecutionException e) {
    +                           // that is what we expect
    +                           // test that the exception nesting is not too 
deep
    +                           assertTrue(e.getCause() == null);
    +                   }
    +                   catch (Exception e) {
    +                           fail("Wrong exception type");
    +                   }
    +           }
    +           catch (Exception e) {
    +                   e.printStackTrace();
    +                   fail(e.getMessage());
    --- End diff --
    
    Why do you print the stack trace and let the test fail with an 
`AssertionError` instead of letting the test fail with the true reason, e.g. 
`e`.


> Fail when actor versions don't match
> ------------------------------------
>
>                 Key: FLINK-2399
>                 URL: https://issues.apache.org/jira/browse/FLINK-2399
>             Project: Flink
>          Issue Type: Improvement
>          Components: JobManager, TaskManager
>    Affects Versions: 0.9, master
>            Reporter: Ufuk Celebi
>            Assignee: Sachin Goel
>            Priority: Minor
>             Fix For: 0.10
>
>
> Problem: there can be subtle errors when actors from different Flink versions 
> communicate with each other, for example when an old client (e.g. Flink 0.9) 
> communicates with a new JobManager (e.g. Flink 0.10-SNAPSHOT).
> We can check that the versions match on first communication between the 
> actors and fail if they don't match.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to