@Test
public void testCoordinatorDiscoveryBackoff() {

    mockClient.prepareResponse(groupCoordinatorResponse(node, Errors.NONE.code()));
    mockClient.prepareResponse(groupCoordinatorResponse(node, Errors.NONE.code()));
    // blackout the coordinator for 50 milliseconds to simulate a disconnect.
    // after backing off, we should be able to connect.
    mockClient.blackout(coordinatorNode, 50L);
    long initialTime = mockTime.milliseconds();
    coordinator.ensureCoordinatorReady();
    long endTime = mockTime.milliseconds();
    assertTrue(endTime - initialTime >= RETRY_BACKOFF_MS);
}