Skip to content

Commit

Permalink
GEODE-1198 CI Failure: DistributedSystemDUnitTest.testConflictingUDPPort
Browse files Browse the repository at this point in the history
Reinstate expectation that SystemConnectException may be thrown when
connecting the second node to the system.  The first node will have grabbed
one UDP port from the membership-port-range but if there isn't another
port free in that range the second node will throw SystemConnectException
instead of GemFireConfigException.
  • Loading branch information
bschuchardt committed Jun 27, 2018
1 parent 6ae3cad commit d8538ee
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPortRange;
import static org.apache.geode.internal.net.SocketCreator.getLocalHost;
import static org.apache.geode.test.dunit.DistributedTestUtils.getDUnitLocatorPort;
import static org.apache.geode.test.dunit.Host.getHost;
import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
Expand All @@ -58,6 +57,7 @@

import org.apache.geode.CancelException;
import org.apache.geode.GemFireConfigException;
import org.apache.geode.SystemConnectException;
import org.apache.geode.cache.AttributesFactory;
import org.apache.geode.cache.Cache;
import org.apache.geode.cache.CacheFactory;
Expand All @@ -70,6 +70,8 @@
import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper;
import org.apache.geode.distributed.internal.membership.gms.messenger.JGroupsMessenger;
import org.apache.geode.distributed.internal.membership.gms.mgr.GMSMembershipManager;
import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
import org.apache.geode.test.junit.categories.DistributedTest;
import org.apache.geode.test.junit.categories.MembershipTest;
Expand Down Expand Up @@ -300,7 +302,7 @@ public void testMembershipPortRangeWithExactThreeValues() throws Exception {
}

@Test
public void testConflictingUDPPort() throws Exception {
public void testConflictingUDPPort() {
Properties config = new Properties();
config.setProperty(MCAST_PORT, String.valueOf(this.mcastPort));
config.setProperty(START_LOCATOR, "localhost[" + this.locatorPort + "]");
Expand All @@ -309,13 +311,14 @@ public void testConflictingUDPPort() throws Exception {

DistributedSystem.connect(config);

getHost(0).getVM(1).invoke(() -> {
IgnoredException.addIgnoredException("SystemConnectException", VM.getVM(1));
VM.getVM(1).invoke(() -> {
String locators = (String) config.remove(START_LOCATOR);

config.put(LOCATORS, locators);

assertThatThrownBy(() -> DistributedSystem.connect(config))
.isInstanceOf(GemFireConfigException.class);
.isInstanceOfAny(GemFireConfigException.class, SystemConnectException.class);
});
}

Expand Down

0 comments on commit d8538ee

Please sign in to comment.