use of org.apache.zookeeper.test.QuorumUtil.PeerStruct in project zookeeper by apache.
the class ZxidRolloverTest method shutdown.
private void shutdown(int idx) throws Exception {
qu.shutdown(idx);
// leader will shutdown, remaining followers will elect a new leader
PeerStruct peer = qu.getPeer(idx);
Assert.assertTrue("Waiting for server down", ClientBase.waitForServerDown("127.0.0.1:" + peer.clientPort, ClientBase.CONNECTION_TIMEOUT));
// disconnected
if (idx == idxLeader) {
checkClientDisconnected(idx);
try {
checkClientsDisconnected();
} catch (AssertionError e) {
// the clients may or may not have already reconnected
// to the recovered cluster, force a check, but ignore
}
} else {
checkClientDisconnected(idx);
}
}
use of org.apache.zookeeper.test.QuorumUtil.PeerStruct in project zookeeper by apache.
the class ZxidRolloverTest method setUp.
@Before
public void setUp() throws Exception {
System.setProperty("zookeeper.admin.enableServer", "false");
// set the snap count to something low so that we force log rollover
// and verify that is working as part of the epoch rollover.
SyncRequestProcessor.setSnapCount(7);
qu = new QuorumUtil(1);
startAll();
for (int i = 0; i < zkClients.length; i++) {
zkClientWatchers[i] = new CountdownWatcher();
PeerStruct peer = qu.getPeer(i + 1);
zkClients[i] = new ZooKeeper("127.0.0.1:" + peer.clientPort, ClientTest.CONNECTION_TIMEOUT, zkClientWatchers[i]);
}
waitForClientsConnected();
}
Aggregations