@Test
@Ignore
public void testRegisterWhenZookeeperDownAndUp() throws Exception {

    namingUrl = new BrpcURL("zookeeper://127.0.0.1:2181");
    namingService = new ZookeeperNamingService(namingUrl);
    RegisterInfo registerInfo = createRegisterInfo("127.0.0.1", 8015);
    namingService.register(registerInfo);
    SubscribeInfo subscribeInfo = createSubscribeInfo(false);
    List<ServiceInstance> instances = namingService.lookup(subscribeInfo);
    Assert.assertTrue(instances.size() == 1);
    Assert.assertTrue(instances.get(0).getIp().equals("127.0.0.1"));
    Assert.assertTrue(instances.get(0).getPort() == 8015);
    // sleep for restarting zookeeper
    Thread.sleep(30 * 1000);
    instances = namingService.lookup(subscribeInfo);
    Assert.assertTrue(instances.size() == 1);
    System.out.println(instances.get(0));
    Assert.assertTrue(instances.get(0).getIp().equals("127.0.0.1"));
    Assert.assertTrue(instances.get(0).getPort() == 8015);
    namingService.unregister(registerInfo);
}