use of com.ctrip.xpipe.redis.core.utils.SimplePsyncObserver in project x-pipe by ctripcorp.
the class FakeRedisHalfRdbServerFail method redisFailKeeperRestartDumpNewRdb.
@Test
public void redisFailKeeperRestartDumpNewRdb() throws Exception {
sleep(sleepBeforeSendFullSyncInfo + 1000);
redisKeeperServer.stop();
redisKeeperServer.dispose();
redisKeeperServer.initialize();
redisKeeperServer.start();
connectToFakeRedis(redisKeeperServer);
waitConditionUntilTimeOut(() -> {
return redisKeeperServer.getRedisMaster().getMasterState() == MASTER_STATE.REDIS_REPL_CONNECTED;
});
SimplePsyncObserver simplePsyncObserver = new SimplePsyncObserver();
InMemoryPsync inMemoryPsync = sendInmemoryPsync("localhost", redisKeeperServer.getListeningPort(), simplePsyncObserver);
// wait
simplePsyncObserver.getOnline().get(5000, TimeUnit.MILLISECONDS);
// wait for commands
sleep(1000);
assertPsyncResultEquals(inMemoryPsync);
Assert.assertEquals(1, redisKeeperServer.getKeeperMonitor().getReplicationStoreStats().getReplicationStoreCreateCount());
}
Aggregations