@Test
    public void testSenderShouldRetryWithBackoffOnRetriableError() {
        final long producerId = 343434L;
        TransactionManager transactionManager = createTransactionManager();
        setupWithTransactionState(transactionManager);
        long start = time.milliseconds();

        // first request is sent immediately
        prepareAndReceiveInitProducerId(producerId, (short) -1, Errors.COORDINATOR_LOAD_IN_PROGRESS);
        long request1 = time.milliseconds();
        assertEquals(start, request1);

        // backoff before sending second request
        prepareAndReceiveInitProducerId(producerId, (short) -1, Errors.COORDINATOR_LOAD_IN_PROGRESS);
        long request2 = time.milliseconds();
        assertEquals(RETRY_BACKOFF_MS, request2 - request1);

        // third request should also backoff
        prepareAndReceiveInitProducerId(producerId, Errors.NONE);
        assertEquals(RETRY_BACKOFF_MS, time.milliseconds() - request2);
    }
Tests the code path where the target node to send FindCoordinator or InitProducerId
is not ready.
clients/src/test/java/org/apache/kafka/clients/producer/internals/SenderTest.java