{
@Test
public void testInstanceBounce() throws Exception
{
String controllerName = CONTROLLER_PREFIX + "_0";
StartCMResult controllerResult = _startCMResultMap.get(controllerName);
ZkHelixTestManager controller = (ZkHelixTestManager) controllerResult._manager;
int handlerSize = controller.getHandlers().size();
for (int i = 0; i < 2; i++)
{
String instanceName = PARTICIPANT_PREFIX + "_" + (START_PORT + i);
// kill 2 participants
_startCMResultMap.get(instanceName)._manager.disconnect();
_startCMResultMap.get(instanceName)._thread.interrupt();
try
{
Thread.sleep(1000);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
// restart the participant
StartCMResult result = TestHelper.startDummyProcess(ZK_ADDR, CLUSTER_NAME, instanceName);
_startCMResultMap.put(instanceName, result);
Thread.sleep(100);
}
Thread.sleep(2000);