@Test
  public void testWaitingMemberList() {
    vm3.invoke(() -> {
      Properties props = getDistributedSystemProperties();
      props.setProperty(JMX_MANAGER, "true");
      props.setProperty(JMX_MANAGER_PORT, String.valueOf(jmxManagerPort));
      props.setProperty(JMX_MANAGER_START, "true");
      props.setProperty(HTTP_SERVICE_PORT, "0");
      getCache(props);
    });

    for (VM vm : toArray(vm0, vm1, vm2)) {
      vm.invoke(() -> createReplicateRegion(regionName, getDiskDirs(getVMId())));
    }

    vm0.invoke(() -> {
      putEntry("A", "B");

      PersistentMemberManager manager = getCache().getPersistentMemberManager();
      Map<String, Set<PersistentMemberID>> waitingRegions = manager.getWaitingRegions();
      assertThat(waitingRegions).isEmpty();

      getCache().close();
    });

    vm1.invoke(() -> {
      updateEntry("A", "C");
      getCache().close();
    });

    vm2.invoke(() -> {
      updateEntry("A", "D");
      getCache().close();
    });

    // These ought to wait for VM2 to come back
    AsyncInvocation<Void> createPersistentRegionInVM0 = vm0.invokeAsync(() -> {
      createReplicateRegion(regionName, getDiskDirs(getVMId()));
    });
    vm0.invoke(this::waitForBlockedInitialization);
    assertThat(createPersistentRegionInVM0.isAlive()).isTrue();

    AsyncInvocation<Void> createPersistentRegionInVM1 = vm1.invokeAsync(() -> {
      createReplicateRegion(regionName, getDiskDirs(getVMId()));
    });
    vm1.invoke(this::waitForBlockedInitialization);
    assertThat(createPersistentRegionInVM1.isAlive()).isTrue();

    vm3.invoke(() -> {
      ManagementService managementService = ManagementService.getManagementService(getCache());

      await().untilAsserted(() -> {
        assertThat(managementService.getDistributedSystemMXBean()).isNotNull();
      });

      DistributedSystemMXBean dsMXBean = managementService.getDistributedSystemMXBean();

      await().untilAsserted(() -> {
        PersistentMemberDetails[] persistentMemberDetails = dsMXBean.listMissingDiskStores();
        assertThat(persistentMemberDetails).hasSize(1);
      });
    });

    vm1.invoke(() -> {
      getCache().close();
    });

    await().until(() -> !createPersistentRegionInVM1.isAlive());

    // Now we should be missing 2 members
    vm3.invoke(() -> {
      ManagementService managementService = ManagementService.getManagementService(getCache());

      await().untilAsserted(() -> {
        assertThat(managementService.getDistributedSystemMXBean()).isNotNull();
      });

      DistributedSystemMXBean dsMXBean = managementService.getDistributedSystemMXBean();

      await().untilAsserted(() -> {
        PersistentMemberDetails[] persistentMemberDetails = dsMXBean.listMissingDiskStores();
        assertThat(persistentMemberDetails).hasSize(2);
      });
    });
  }
Test which members show up in the list of members we're waiting on.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java