flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mjsax <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-2111] Add "stop" signal to cleanly shut...
Date Tue, 01 Dec 2015 17:12:40 GMT
Github user mjsax commented on a diff in the pull request:

    https://github.com/apache/flink/pull/750#discussion_r46307098
  
    --- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerTest.java
---
    @@ -227,4 +235,121 @@ 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(StoppableInvokable.class);
    +
    +				final JobGraph jobGraph = new JobGraph("Blocking test job", JobType.STREAMING, sender);
    +				final JobID jid = jobGraph.getJobID();
    +
    +				final ActorGateway jobManagerGateway = cluster.getLeaderGateway(TestingUtils.TESTING_DURATION());
    +
    +				// 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(), null);
    +
    +				// Submit the job and wait for all vertices to be running
    +				jobManagerGateway.tell(
    +						new SubmitJob(
    +								jobGraph,
    +								ListeningBehaviour.EXECUTION_RESULT),
    +						testActorGateway);
    +				expectMsgClass(JobManagerMessages.JobSubmitSuccess.class);
    +
    +				jobManagerGateway.tell(new StopJob(jid), testActorGateway);
    +
    +				// - The test ----------------------------------------------------------------------
    +				expectMsgClass(StoppingSuccess.class);
    --- End diff --
    
    I tried to make this work, but without success... I added the following two lines:
    ```
    jobManagerGateway.tell(new NotifyWhenJobRemoved(jid), testActorGateway);
    expectMsgEquals(true);
    ```
    But the returned message is `JobResultFailure` instead of `true` (I was looking at `JobManagerITCase.scala`
in which `NotifyWhenJobRemoved` is also used and which expects `true` as return value).
    
    As I am not familiar with Akka I need your input here.


---
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.
---

Mime
View raw message