@Override
        public void onChange(final Thread thread,
                             final ThreadStateTransitionValidator newState,
                             final ThreadStateTransitionValidator oldState) {
            if (newState == StreamThread.State.PENDING_SHUTDOWN) {
                toPendingShutdownSeen = true;
            }
        }
Repeatedly runs the query until the response is valid and then return the response.
<p>
Validity in this case means that the response position is up to the specified bound.
<p>
Once position bounding is generally supported, we should migrate tests to wait on the
expected response position.
streams/src/test/java/org/apache/kafka/streams/integration/utils/IntegrationTestUtils.java