}
@Test(timeout = 10000l)
public void testBarrierWorksWithManyClients() throws Exception{
final int numClients=9;
cyclicBarrier = new ZkCyclicBarrier(numClients, new BaseZkSessionManager(zk), barrierPath);
List<Future<Void>> futures = new ArrayList<Future<Void>>(numClients);
for(int client=0;client<numClients;client++){
futures.add(executor.submit(new Callable<Void>() {
@Override
public Void call() throws Exception {
ZooKeeper otherZooKeeper = newZooKeeper();
try {
DistributedCyclicBarrier otherCyclicBarrier = new ZkCyclicBarrier(numClients, new BaseZkSessionManager(otherZooKeeper), barrierPath);
// System.out.printf("%s: Waiting on barrier%n",Thread.currentThread().getName());
otherCyclicBarrier.await();
} finally {
otherZooKeeper.close();
}