public static void awaitLatchOrTimeout(CountDownLatch latch, long timeoutMs)
      throws TimeoutException, InterruptedException {
    if (!latch.await(timeoutMs, TimeUnit.MILLISECONDS)) {
      throw new TimeoutException("Too long time to complete operation.");
    }
  }
Awaits on the passed-in {@link CountDownLatch}. If times out throws an exception.
@param latch The latch to await on.
@param timeoutMs Timeout in millisecond.
@throws TimeoutException If awaits for more than the specified time, throw a {@link TimeoutException}.
@throws InterruptedException If wait is interrupted.
ambry-test-utils/src/main/java/com/github/ambry/utils/TestUtils.java