String instanceName = "localhost_" + (12918 + i);
if (i == 4)
{
participants[i] =
new MockParticipant(clusterName,
instanceName,
ZK_ADDR,
new KillOtherTransition(participants[0]));
}
else
{
participants[i] =
new MockParticipant(clusterName,
instanceName,
ZK_ADDR,
null);
// Thread.sleep(100);
}
participants[i].syncStart();
}
boolean result =
ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
clusterName));
Assert.assertTrue(result);
// restart
Thread.sleep(500);
MockParticipant participant =
new MockParticipant(participants[0].getClusterName(),
participants[0].getInstanceName(),
ZK_ADDR,
null);
System.err.println("Restart " + participant.getInstanceName());
participant.syncStart();
result =
ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
clusterName));
Assert.assertTrue(result);