DefaultRedisMasterReplication extends AbstractRedisMasterReplication { public void setMasterConnectRetryDelaySeconds(int masterConnectRetryDelaySeconds) { this.masterConnectRetryDelaySeconds = masterConnectRetryDelaySeconds; } DefaultRedisMasterReplication(RedisMaster redisMaster, RedisKeeperServer redisKeeperServer,
										 NioEventLoopGroup nioEventLoopGroup, ScheduledExecutorService scheduled,
										 int replTimeoutMilli, KeeperResourceManager resourceManager);  DefaultRedisMasterReplication(RedisMaster redisMaster, RedisKeeperServer redisKeeperServer,
										 NioEventLoopGroup nioEventLoopGroup, ScheduledExecutorService scheduled,
										 KeeperResourceManager resourceManager); @Override void masterConnected(Channel channel); @Override void masterDisconntected(Channel channel); void setMasterConnectRetryDelaySeconds(int masterConnectRetryDelaySeconds); @Override void stopReplication(); @Override PARTIAL_STATE partialState();  }
@Test public void testTimeout() throws Exception { Server server = startEmptyServer(); when(redisMaster.masterEndPoint()).thenReturn(new DefaultEndPoint("localhost", server.getPort())); AtomicInteger connectingCount = new AtomicInteger(0); doAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { connectingCount.incrementAndGet(); return null; } }).when(redisMaster).setMasterState(MASTER_STATE.REDIS_REPL_CONNECTING); defaultRedisMasterReplication.setMasterConnectRetryDelaySeconds(0); defaultRedisMasterReplication.initialize(); defaultRedisMasterReplication.start(); waitConditionUntilTimeOut(() -> connectingCount.get() >= 2, 5000); }