servitorThreads[i].join();
try { servitorThreads[i].join(); } catch (InterruptedException e) { throw new PerfException("Thread interrupted"); }
   protected void runTest() throws Exception   {      failed = false;            Thread[] servitorThreads = new Thread[numSessions];            Servitor[] servitors = new Servitor[numSessions];            for (int i = 0; i < numSessions; i++)      {         Servitor servitor = createServitor(numMessages);         servitor.init();         servitors[i] = servitor;      }                        long now = System.currentTimeMillis();            //Wait until timeToStart      if (now >= timeToStart)      {         log.error("Already passed timeToStart");         failed = true;         return;      }            long toSleep = timeToStart - now;      log.info("Sleeping for " + toSleep + " ms");      Thread.sleep(toSleep);      log.info("Done sleeping");            startTime = System.currentTimeMillis();                  for (int i = 0; i < numSessions; i++)      {                  servitorThreads[i] = new Thread(servitors[i]);         servitorThreads[i].start();      }                  for (int i = 0; i < numSessions; i++)      {         servitorThreads[i].join();      }            endTime = System.currentTimeMillis();      List throwablesList = new ArrayList();            for (int i = 0; i < numSessions; i++)      {         Servitor servitor = servitors[i];         servitor.deInit();         if (servitor.isFailed())         {            log.info("Servitor failed");            failed = true;            if (servitor.getThrowable() != null)            {               log.info("Got a throwable: " + servitor.getThrowable());               throwablesList.add(servitor.getThrowable());            }         }      }             if (!throwablesList.isEmpty())      {         throwables = new Throwable[throwablesList.size()];                  Iterator iter = throwablesList.iterator();         int i = 0;         while (iter.hasNext())         {            throwables[i++] = (Throwable)iter.next();         }               }            log.info("Throwables array is: " + throwables);                     }