public void awaitRecords(long timeout) throws InterruptedException {
        if (recordsRemainingLatch == null || expectedRecords < 0) {
            throw new IllegalStateException("expectedRecords() was not set for this connector?");
        }
        if (!recordsRemainingLatch.await(timeout, TimeUnit.MILLISECONDS)) {
            String msg = String.format(
                    "Insufficient records seen by connector %s in %d millis. Records expected=%d, actual=%d",
                    connectorName,
                    timeout,
                    expectedRecords,
                    expectedRecords - recordsRemainingLatch.getCount());
            throw new DataException(msg);
        }
    }
Wait for this connector to meet the expected number of records as defined by {@code
expectedRecords}.

@param timeout max duration to wait for records
@throws InterruptedException if another threads interrupts this one while waiting for records
connect/runtime/src/test/java/org/apache/kafka/connect/integration/ConnectorHandle.java