You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by dw...@apache.org on 2018/11/15 08:26:28 UTC

[flink] branch master updated: [FLINK-10419] Call JobMasterGateway through RpcCheckpointResponder in test

This is an automated email from the ASF dual-hosted git repository.

dwysakowicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new 2b0ead9  [FLINK-10419] Call JobMasterGateway through RpcCheckpointResponder in test
2b0ead9 is described below

commit 2b0ead90f17788c3f4e8d9b276c6b7eb6896997f
Author: Dawid Wysakowicz <dw...@apache.org>
AuthorDate: Wed Nov 14 13:24:52 2018 +0100

    [FLINK-10419] Call JobMasterGateway through RpcCheckpointResponder in test
---
 .../flink/runtime/jobmaster/JobMasterTest.java     | 23 +++++++++++-----------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTest.java
index b1f0284..de3f787 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTest.java
@@ -103,6 +103,7 @@ import org.apache.flink.runtime.state.StreamStateHandle;
 import org.apache.flink.runtime.state.memory.ByteStreamStateHandle;
 import org.apache.flink.runtime.taskexecutor.TestingTaskExecutorGateway;
 import org.apache.flink.runtime.taskexecutor.TestingTaskExecutorGatewayBuilder;
+import org.apache.flink.runtime.taskexecutor.rpc.RpcCheckpointResponder;
 import org.apache.flink.runtime.taskexecutor.slot.SlotOffer;
 import org.apache.flink.runtime.taskmanager.LocalTaskManagerLocation;
 import org.apache.flink.runtime.taskmanager.TaskExecutionState;
@@ -303,18 +304,16 @@ public class JobMasterTest extends TestLogger {
 
 			Throwable userException = (Throwable) Class.forName(className, false, userClassLoader).newInstance();
 
-			CompletableFuture<JobMasterGateway> jobMasterGateway =
-				rpcService2.connect(jobMaster.getAddress(), jobMaster.getFencingToken(), JobMasterGateway.class);
-
-			jobMasterGateway.thenAccept(gateway -> {
-				gateway.declineCheckpoint(new DeclineCheckpoint(
-						jobGraph.getJobID(),
-						new ExecutionAttemptID(1, 1),
-						1,
-						userException
-					)
-				);
-			});
+			JobMasterGateway jobMasterGateway =
+				rpcService2.connect(jobMaster.getAddress(), jobMaster.getFencingToken(), JobMasterGateway.class).get();
+
+			RpcCheckpointResponder rpcCheckpointResponder = new RpcCheckpointResponder(jobMasterGateway);
+			rpcCheckpointResponder.declineCheckpoint(
+				jobGraph.getJobID(),
+				new ExecutionAttemptID(1, 1),
+				1,
+				userException
+			);
 
 			Throwable throwable = declineCheckpointMessageFuture.get(testingTimeout.toMilliseconds(),
 				TimeUnit.MILLISECONDS);