Github user mjsax commented on a diff in the pull request:
https://github.com/apache/flink/pull/750#discussion_r38129641
--- Diff:
flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerTest.java
---
@@ -218,4 +228,113 @@ public void testRequestPartitionState() throws
Exception {
}
}};
}
+
+ @Test
+ public void testStopSignal() throws Exception {
+ new JavaTestKit(system) {{
+ // Setup
+ TestingCluster cluster = null;
+
+ try {
+ cluster = startTestingCluster(2, 1,
DEFAULT_AKKA_ASK_TIMEOUT());
+
+ // Create a task
+ final JobVertex sender = new
JobVertex("Sender");
+ sender.setParallelism(2);
+
sender.setInvokableClass(StopableInvokable.class);
+
+ final JobGraph jobGraph = new
JobGraph("Blocking test job", JobType.STREAMING, sender);
+ final JobID jid = jobGraph.getJobID();
+
+ final ActorGateway jm =
cluster.getJobManagerGateway();
+
+ // we can set the leader session ID to None
because we don't use this gateway to send messages
+ final ActorGateway testActorGateway = new
AkkaActorGateway(getTestActor(), Option.<UUID>empty());
+
+ // Submit the job and wait for all vertices to
be running
+ jm.tell(new SubmitJob(jobGraph, false),
testActorGateway);
+ expectMsgClass(Status.Success.class);
+
+ jm.tell(new StopJob(jid), testActorGateway);
+
+ // - The test
----------------------------------------------------------------------
+ expectMsgClass(StoppingSuccess.class);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage());
--- End diff --
Just had a look here. There is a finally statement, thus removing the
try-catch block is not an option. And `fail()` takes only a String argument, no
exceptions. I think it's best to leave it as it is.
---
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.
---