private void waitForListenerToFinish(VM vm) {
    logger.info("DBG GEODE-7474: waitForListenerToFinish entered");

    vm.invoke("wait for listener to finish", () -> {
      logger.info("DBG GEODE-7474: waitForListenerToFinish 1");

      assertThat(DistributionMessageObserver.getInstance())
          .withFailMessage("listener was not invoked")
          .isNull();
      logger.info("DBG GEODE-7474: waitForListenerToFinish 2");

      await("listener to finish")
          .untilAsserted(() -> {
            assertThat(listenerHasFinished).isTrue();
            logger.info("DBG GEODE-7474: waitForListenerToFinish 3");
          });
    });

    logger.info("DBG GEODE-7474: waitForListenerToFinish finished");
  }
When a replicate fails after responding to a query message, the net search should fail over to
the next replicate that responded.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/NetSearchMessagingDUnitTest.java