[ https://issues.apache.org/jira/browse/FLINK-4516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15448821#comment-15448821 ]
ASF GitHub Bot commented on FLINK-4516: --------------------------------------- Github user beyond1920 commented on a diff in the pull request: https://github.com/apache/flink/pull/2427#discussion_r76779266 --- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/rpc/resourcemanager/ResourceManagerHATest.java --- @@ -0,0 +1,86 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.runtime.rpc.resourcemanager; + +import akka.util.Timeout; +import org.apache.flink.runtime.highavailability.TestingHighAvailabilityServices; +import org.apache.flink.runtime.leaderelection.TestingLeaderElectionService; +import org.apache.flink.runtime.rpc.RpcService; +import org.apache.flink.runtime.rpc.TestingRpcService; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import scala.concurrent.Await; +import scala.concurrent.Future; + +import java.util.UUID; +import java.util.concurrent.Callable; +import java.util.concurrent.TimeUnit; + +/** + * resourceManager HA test, including grant leadership and revoke leadership + */ +public class ResourceManagerHATest { + + private RpcService rpcService; + + @Before + public void setup() throws Exception { + rpcService = new TestingRpcService(); + } + + @After + public void teardown() throws Exception { + rpcService.stopService(); + } + + @Test + public void testGrantAndRevokeLeadership() throws Exception { --- End diff -- Hi till, thanks for your good advice. I add a new rpcService implementation for test. > ResourceManager leadership election > ----------------------------------- > > Key: FLINK-4516 > URL: https://issues.apache.org/jira/browse/FLINK-4516 > Project: Flink > Issue Type: Sub-task > Components: Cluster Management > Reporter: zhangjing > Assignee: zhangjing > > 1. When a resourceManager is started, it starts the leadership election > service first and take part in contending for leadership > 2. Every resourceManager contains a ResourceManagerLeaderContender, when it > is granted leadership, it will start SlotManager and other main components. > when it is revoked leadership, it will stop all its components and clear > everything. -- This message was sent by Atlassian JIRA (v6.3.4#6332)