@Test
  public void testInterestRecoveryFailure() throws Exception {
    addIgnoredException("Server unreachable");

    PORT1 = server1.invoke(HAInterestTestCase::createServerCache);
    server1.invoke(HAInterestTestCase::createEntriesK1andK2);
    PORT2 = server2.invoke(HAInterestTestCase::createServerCache);
    server2.invoke(HAInterestTestCase::createEntriesK1andK2);
    createClientPoolCacheWithSmallRetryInterval(getName(),
        getServerHostName(server1.getHost()));
    registerK1AndK2();
    verifyRefreshedEntriesFromServer();
    VM backup = getBackupVM();
    VM primary = getPrimaryVM();

    backup.invoke(HAInterestTestCase::stopServer);
    primary.invoke(HAInterestTestCase::stopServer);
    verifyDeadAndLiveServers(2, 0);

    primary.invoke(HAInterestTestCase::putK1andK2);
    setClientServerObserverForBeforeInterestRecoveryFailure();
    primary.invoke(HAInterestTestCase::startServer);
    waitForBeforeInterestRecoveryCallBack();
    if (exceptionOccurred) {
      fail("The DSM could not ensure that server 1 is started & serevr 2 is stopped");
    }
    final Region r1 = cache.getRegion(SEPARATOR + REGION_NAME);
    assertNotNull(r1);

    WaitCriterion wc = new WaitCriterion() {
      private String excuse;

      @Override
      public boolean done() {
        Entry e1 = r1.getEntry(k1);
        Entry e2 = r1.getEntry(k2);
        if (e1 == null) {
          excuse = "Entry for k1 still null";
          return false;
        }
        if (e2 == null) {
          excuse = "Entry for k2 still null";
          return false;
        }
        if (!(server_k1.equals(e1.getValue()))) {
          excuse = "Value for k1 wrong";
          return false;
        }
        if (!(server_k2.equals(e2.getValue()))) {
          excuse = "Value for k2 wrong";
          return false;
        }
        return true;
      }

      @Override
      public String description() {
        return excuse;
      }
    };
    GeodeAwaitility.await().untilAsserted(wc);
  }
Tests if failure occurred in Interest recovery thread, then it should select new endpoint to
register interest
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/HAInterestPart2DUnitTest.java