public static void waitForCondition(final TestCondition testCondition, final long maxWaitMs, Supplier<String> conditionDetailsSupplier) throws InterruptedException {
        waitForCondition(testCondition, maxWaitMs, DEFAULT_POLL_INTERVAL_MS, conditionDetailsSupplier);
    }
Wait for condition to be met for at most {@code maxWaitMs} and throw assertion failure otherwise.
This should be used instead of {@code Thread.sleep} whenever possible as it allows a longer timeout to be used
without unnecessarily increasing test time (as the condition is checked frequently). The longer timeout is needed to
avoid transient failures due to slow or overloaded machines.
clients/src/test/java/org/apache/kafka/test/TestUtils.java