@Override
    public void beforeMembershipFailure(String reason, Throwable cause) {
      System.out.println("Inside TestHook.beforeMembershipFailure with " + cause);
      long giveUp = System.currentTimeMillis() + 30000;
      if (cause instanceof ForcedDisconnectException) {
        while (unboundedWait && System.currentTimeMillis() < giveUp) {
          Wait.pause(1000);
        }
      } else {
        errorCollector.addError(cause);
      }
    }
New test hook which blocks before closing channel.
geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java