@Test
    public void testFetchResultNotProcessedForPartitionsAwaitingCallbackCompletion() {
        buildFetcher();

        assignFromUser(singleton(tp0));
        subscriptions.seek(tp0, 0);

        // Successfully fetch from partition (not marked as involved in the callback yet)
        assertNonEmptyFetch();

        // Mark partition as pendingOnAssignedCallback. No records should be fetched for it
        subscriptions.markPendingOnAssignedCallback(singleton(tp0), true);
        assertEquals(0, sendFetches());
        networkClientDelegate.poll(time.timer(0));
        assertFalse(fetcher.hasCompletedFetches());

        // Successfully start fetching again, once the partition is not waiting for the callback anymore
        subscriptions.enablePartitionsAwaitingCallback(singleton(tp0));
        assertNonEmptyFetch();
    }
This validates that no records are fetched for partitions that are waiting for the
onPartitionsAssigned callback to complete. Note that this markPendingOnAssignedCallback
functionality is only used from the {@link AsyncKafkaConsumer}.
clients/src/test/java/org/apache/kafka/clients/consumer/internals/FetchRequestManagerTest.java