@Test
  public void testMultipleLocatorsRestartingAtSameTimeWithMissingServers() throws Exception {
    addIgnoredException("ForcedDisconnectException");
    addIgnoredException("Possible loss of quorum");
    addIgnoredException("java.lang.Exception: Message id is");

    String locators =
        hostName + "[" + port1 + "]," + hostName + "[" + port2 + "]," + hostName + "[" + port3
            + "]";

    Properties dsProps = getBasicProperties(locators);
    dsProps.setProperty(LOG_LEVEL, logger.getLevel().name());
    dsProps.setProperty(DISABLE_AUTO_RECONNECT, "true");
    dsProps.setProperty(MEMBER_TIMEOUT, "2000");
    addDSProps(dsProps);

    startLocator(vm0, dsProps, port1);
    startLocator(vm1, dsProps, port2);
    startLocator(vm2, dsProps, port3);

    vm3.invoke(() -> {
      getConnectedDistributedSystem(dsProps);
    });
    vm4.invoke(() -> {
      getConnectedDistributedSystem(dsProps);

      await().until(() -> system.getDM().getViewMembers().size() == 5);
    });

    vm0.invoke(this::forceDisconnect);
    vm1.invoke(this::forceDisconnect);
    vm2.invoke(this::forceDisconnect);

    SerializableRunnable waitForDisconnect = new SerializableRunnable("waitForDisconnect") {
      @Override
      public void run() {
        await()
            .until(() -> system == null);
      }
    };
    vm0.invoke(() -> waitForDisconnect);
    vm1.invoke(() -> waitForDisconnect);
    vm2.invoke(() -> waitForDisconnect);

    String newLocators = hostName + "[" + port2 + "]," + hostName + "[" + port3 + "]";
    dsProps.setProperty(LOCATORS, newLocators);

    getBlackboard().initBlackboard();
    AsyncInvocation<Void> async1 = vm1.invokeAsync(() -> {
      getBlackboard().signalGate("vm1ready");
      getBlackboard().waitForGate("readyToConnect", 30, SECONDS);
      System.out.println("vm1 is ready to connect");
      startLocatorBase(dsProps, port2);
    });
    AsyncInvocation<Void> async2 = vm2.invokeAsync(() -> {
      getBlackboard().signalGate("vm2ready");
      getBlackboard().waitForGate("readyToConnect", 30, SECONDS);
      System.out.println("vm2 is ready to connect");
      startLocatorBase(dsProps, port3);
    });
    getBlackboard().waitForGate("vm1ready", 30, SECONDS);
    getBlackboard().waitForGate("vm2ready", 30, SECONDS);
    getBlackboard().signalGate("readyToConnect");

    async1.await();
    async2.await();

    vm1.invoke("waitUntilLocatorBecomesCoordinator", this::waitUntilLocatorBecomesCoordinator);
    vm2.invoke("waitUntilLocatorBecomesCoordinator", this::waitUntilLocatorBecomesCoordinator);

    await().untilAsserted(() -> {
      MemberIdentifier viewCreator = vm1.invoke(() -> getView().getCreator());
      MemberIdentifier viewCreator2 = vm1.invoke(() -> getView().getCreator());

      InternalDistributedMember member1 = vm1.invoke(this::getMember);
      InternalDistributedMember member2 = vm2.invoke(this::getMember);

      assertThat(viewCreator2).isEqualTo(viewCreator);
      assertThat(viewCreator).isIn(member1, member2);
      assertThat(member1).isNotEqualTo(member2);

    });

  }
Tests starting multiple locators at the same time and ensuring that the locators end up only
have 1 master. GEODE-870
geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java