geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject incubator-geode git commit: GEODE-899 LocatorDUnitTest.testLeadFailureAndCoordShutdown
Date Tue, 16 Feb 2016 18:58:02 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop bef0c1bec -> 71ba8e999


GEODE-899 LocatorDUnitTest.testLeadFailureAndCoordShutdown

This test was getting two random tcp/ip ports in multiple calls to
AvailablePort.getRandomAvailablePort.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/71ba8e99
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/71ba8e99
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/71ba8e99

Branch: refs/heads/develop
Commit: 71ba8e9995f485a4dd67805e04627b987dad32d6
Parents: bef0c1b
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Tue Feb 16 10:57:48 2016 -0800
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Tue Feb 16 10:57:48 2016 -0800

----------------------------------------------------------------------
 .../gemfire/distributed/LocatorDUnitTest.java   | 32 +++++++++++---------
 1 file changed, 17 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/71ba8e99/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
index 545a0ea..f74e0de 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
@@ -257,9 +257,10 @@ public class LocatorDUnitTest extends DistributedTestCase {
     VM loc1 = host.getVM(1);
     VM loc2 = host.getVM(2);
     
-    final int port1 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+    int ports[] = AvailablePortHelper.getRandomAvailableTCPPorts(2);
+    final int port1 = ports[0];
     this.port1 = port1;
-    final int port2 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+    final int port2 = ports[1];
     this.port2 = port2; // for cleanup in tearDown2
     DistributedTestUtils.deleteLocatorStateFile(port1);
     DistributedTestUtils.deleteLocatorStateFile(port2);
@@ -490,10 +491,10 @@ public class LocatorDUnitTest extends DistributedTestCase {
     VM locvm = host.getVM(3);
     Locator locator = null;
     
-    final int port1 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+    int ports[] = AvailablePortHelper.getRandomAvailableTCPPorts(2);
+    final int port1 = ports[0];
     this.port1 = port1;
-    final int port2 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    this.port2 = port2; // for cleanup in tearDown2()
+    final int port2 = ports[1];
     DistributedTestUtils.deleteLocatorStateFile(port1, port2);
     final String host0 = NetworkUtils.getServerHostName(host); 
     final String locators = host0 + "[" + port1 + "]," +
@@ -625,9 +626,10 @@ public class LocatorDUnitTest extends DistributedTestCase {
     VM locvm = host.getVM(3);
     Locator locator = null;
     
-    final int port1 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+    final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(2);
+    final int port1 = ports[0];
     this.port1 = port1;
-    final int port2 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+    final int port2 = ports[1];
     this.port2 = port2;
     DistributedTestUtils.deleteLocatorStateFile(port1, port2);
     final String host0 = NetworkUtils.getServerHostName(host);
@@ -772,10 +774,10 @@ public class LocatorDUnitTest extends DistributedTestCase {
     VM locvm = host.getVM(3);
     Locator locator = null;
     
-    final int port1 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+    int ports[] = AvailablePortHelper.getRandomAvailableTCPPorts(2);
+    final int port1 = ports[0];
     this.port1 = port1;
-    final int port2 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    this.port2 = port2;
+    final int port2 = ports[1];
     DistributedTestUtils.deleteLocatorStateFile(port1, port2);
     final String host0 = NetworkUtils.getServerHostName(host);
     final String locators = host0 + "[" + port1 + "]," + host0 + "[" + port2 + "]";
@@ -911,10 +913,10 @@ public class LocatorDUnitTest extends DistributedTestCase {
     VM locvm = host.getVM(3);
     Locator locator = null;
     
-    final int port1 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+    int ports[] = AvailablePortHelper.getRandomAvailableTCPPorts(2);
+    final int port1 = ports[0];
     this.port1 = port1;
-    final int port2 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    this.port2 = port2;
+    final int port2 = ports[1];
     DistributedTestUtils.deleteLocatorStateFile(port1, port2);
     final String host0 = NetworkUtils.getServerHostName(host);
     final String locators = host0 + "[" + port1 + "],"
@@ -1149,11 +1151,11 @@ public class LocatorDUnitTest extends DistributedTestCase {
         return !coord.equals(MembershipManagerHelper.getCoordinator(system));
       }
       public String description() {
-        return "expected the coordinator to be " + coord + " but it is " +
+        return "expected the coordinator to not be " + coord + " but it is " +
           MembershipManagerHelper.getCoordinator(system);
       }
     };
-    Wait.waitForCriterion(ev, 15 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 15 * 1000, 200, false);
     DistributedMember newCoord = MembershipManagerHelper.getCoordinator(system); 
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("coordinator after
shutdown of locator was " +
         newCoord);


Mime
View raw message