public void waitForMessagesSent(int count) throws InterruptedException {
      while (true) {
        synchronized (messageLock) {
          assert sentCount <= count;
          if (sentCount == count) {
            sentCount = 0;
            return;
          }
          messageLock.wait(200);
        }
      }
    }
@param timeoutMs
@return false if the time elapsed
@throws InterruptedException
llap-tez/src/test/org/apache/hadoop/hive/llap/tezplugins/TestLlapTaskSchedulerService.java