+ "");
_setupTool.rebalanceStorageCluster(CLUSTER_NAME, db2, 1);
String instance2 = "localhost_279699";
// StartCMResult result = TestHelper.startDummyProcess(zkaddr, CLUSTER_NAME, instance2);
MockParticipant newParticipant = new MockParticipant(_zkaddr, CLUSTER_NAME, instance2);
newParticipant.syncStart();
Thread.sleep(500);
// Assert.assertFalse(result._thread.isAlive());
Assert.assertTrue(null == manager.getHelixDataAccessor().getProperty(
accessor.keyBuilder().liveInstance(instance2)));
HelixConfigScope scope =
new HelixConfigScopeBuilder(ConfigScopeProperty.CLUSTER).forCluster(CLUSTER_NAME).build();
manager.getConfigAccessor().set(scope, ZKHelixManager.ALLOW_PARTICIPANT_AUTO_JOIN, "true");
newParticipant = new MockParticipant(_zkaddr, CLUSTER_NAME, instance2);
newParticipant.syncStart();
Thread.sleep(500);
// Assert.assertTrue(result._thread.isAlive() || result2._thread.isAlive());
for (int i = 0; i < 20; i++) {
if (null == manager.getHelixDataAccessor().getProperty(
accessor.keyBuilder().liveInstance(instance2))) {
Thread.sleep(100);
} else
break;
}
Assert.assertTrue(null != manager.getHelixDataAccessor().getProperty(
accessor.keyBuilder().liveInstance(instance2)));
newParticipant.syncStop();
}