@Test
  public void gatewayReceiverCreationFailsAndDoesNotHangWhenConfiguredBindAddressIsNotUsable() {
    Integer lnPort = vm0.invoke(() -> createFirstLocatorWithDSId(1));

    vm2.invoke(() -> {
      Properties props = getDistributedSystemProperties();
      props.setProperty(MCAST_PORT, "0");
      props.setProperty(LOCATORS, "localhost[" + lnPort + "]");
      cache = new CacheFactory(props).create();

      GatewayReceiverFactory fact = cache.createGatewayReceiverFactory();
      int port = AvailablePortHelper.getRandomAvailableTCPPort();
      fact.setStartPort(port);
      fact.setEndPort(port);
      fact.setManualStart(true);
      fact.setBindAddress("200.112.204.10");
      GatewayReceiver receiver = fact.create();
      assertThatThrownBy(receiver::start)
          .isInstanceOf(GatewayReceiverException.class)
          .hasMessageContaining("No available free port found in the given range");
    });
  }
Two VMs are part of the DS. One VM hosts a cache server while the other hosts a Receiver.
Expected: Cache.getCacheServers should only return the bridge server and not the Receiver.
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/WanValidationsDUnitTest.java