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

    https://github.com/apache/flink/pull/945#discussion_r37977961
  
    --- 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);
    --- End diff --
    
    Better to test for the proper exception message.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to