geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [1/4] incubator-geode git commit: enabling multicast communications and fixing a locator auto-restart problem. This disables the use of multicast for discovery and all tests that were doing that have been changed to use locators.
Date Tue, 11 Aug 2015 21:51:21 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-77 14d378647 -> 3c560cb93


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3c560cb9/gemfire-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
index ef5f312..86b0e20 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
@@ -49,8 +49,6 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
 
   private VM locator;
   
-  protected int mCastPort;
-
 
   public LocatorManagementDUnitTest(String name) {
     super(name);
@@ -61,8 +59,6 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
   public void setUp() throws Exception {
     super.setUp();
     locator = managedNode1;
-    
-    mCastPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS);
   }
 
   public void tearDown2() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3c560cb9/gemfire-core/src/test/java/com/gemstone/gemfire/test/golden/GoldenTestCase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/test/golden/GoldenTestCase.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/test/golden/GoldenTestCase.java
index 37b4e48..53c053d 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/test/golden/GoldenTestCase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/test/golden/GoldenTestCase.java
@@ -30,7 +30,7 @@ public abstract class GoldenTestCase extends TestCase {
 
   protected final Logger logger = LogService.getLogger();
   
-  private final int mcastPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS);
+  private final int locatorPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
   private final List<ProcessWrapper> processes = new ArrayList<ProcessWrapper>();
   
   static {
@@ -137,7 +137,7 @@ public abstract class GoldenTestCase extends TestCase {
 
   protected final Properties createProperties() {
     Properties properties = new Properties();
-    properties.setProperty("gemfire.mcast-port", String.valueOf(this.mcastPort));
+    properties.setProperty("gemfire.start-locator", "localhost[" + String.valueOf(this.locatorPort)
+ "]");
     properties.setProperty("gemfire.log-level", "warning");
     properties.setProperty("file.encoding", "UTF-8");
     return editProperties(properties);
@@ -151,7 +151,7 @@ public abstract class GoldenTestCase extends TestCase {
   }
   
   protected final int getMcastPort() {
-    return this.mcastPort;
+    return this.locatorPort;
   }
   
   // TODO: get rid of this to tighten up tests

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3c560cb9/gemfire-core/src/test/java/dunit/DistributedTestCase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/dunit/DistributedTestCase.java b/gemfire-core/src/test/java/dunit/DistributedTestCase.java
index 358c256..7aa4a27 100755
--- a/gemfire-core/src/test/java/dunit/DistributedTestCase.java
+++ b/gemfire-core/src/test/java/dunit/DistributedTestCase.java
@@ -603,31 +603,6 @@ public abstract class DistributedTestCase extends TestCase implements
java.io.Se
   }
 
   /**
-   * Returns an mcast distributed system that is connected to other
-   * vms using a random mcast port.
-   */
-  public final InternalDistributedSystem getMcastSystem() {
-    Properties props = this.getDistributedSystemProperties();
-    int port = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS);
-    props.put(DistributionConfig.MCAST_PORT_NAME, ""+port);
-    props.put(DistributionConfig.MCAST_TTL_NAME, "0");
-    props.put(DistributionConfig.LOCATORS_NAME, "");
-    return getSystem(props);
-  }
-
-  /**
-   * Returns an mcast distributed system that is connected to other
-   * vms using the given mcast port.
-   */
-  public final InternalDistributedSystem getMcastSystem(int jgroupsPort) {
-    Properties props = this.getDistributedSystemProperties();
-    props.put(DistributionConfig.MCAST_PORT_NAME, ""+jgroupsPort);
-    props.put(DistributionConfig.MCAST_TTL_NAME, "0");
-    props.put(DistributionConfig.LOCATORS_NAME, "");
-    return getSystem(props);
-  }
-
-  /**
    * Returns whether or this VM is connected to a {@link
    * DistributedSystem}.
    */
@@ -969,7 +944,8 @@ public abstract class DistributedTestCase extends TestCase implements
java.io.Se
    * returning.
    */
   public static final void pause(int ms) {
-    if (ms > 50) {
+    LogWriter log = getLogWriter();
+    if (ms >= 1000 || log.fineEnabled()) { // check for fine but log at info
       getLogWriter().info("Pausing for " + ms + " ms..."/*, new Exception()*/);
     }
     final long target = System.currentTimeMillis() + ms;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3c560cb9/gemfire-core/src/test/java/dunit/standalone/DUnitLauncher.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/dunit/standalone/DUnitLauncher.java b/gemfire-core/src/test/java/dunit/standalone/DUnitLauncher.java
index 0f2eebc..cb1900c 100644
--- a/gemfire-core/src/test/java/dunit/standalone/DUnitLauncher.java
+++ b/gemfire-core/src/test/java/dunit/standalone/DUnitLauncher.java
@@ -95,6 +95,12 @@ public class DUnitLauncher {
 
   private static final String LAUNCHED_PROPERTY = "gemfire.DUnitLauncher.LAUNCHED";
 
+//  static {
+//    if (ProcessManager.IS_WINDOWS) {
+//      System.setProperty("-Djava.net.preferIPv4Stack", "true");
+//    }
+//  }
+
   private DUnitLauncher() {
   }
   
@@ -234,6 +240,10 @@ public class DUnitLauncher {
         //Disable the shared configuration on this locator.
         //Shared configuration tests create their own locator
         p.setProperty("enable-cluster-configuration", "false");
+        //Tell the locator it's the first in the system for
+        //faster boot-up
+        System.setProperty("gemfire.first-member", "true");
+        
         Locator.startLocatorAndDS(locatorPort, locatorLogFile, p);
         return null;
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3c560cb9/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java b/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java
index 5b38816..3dc0678 100644
--- a/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java
+++ b/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java
@@ -38,6 +38,7 @@ import dunit.RemoteDUnitVMIF;
  *
  */
 public class ProcessManager {
+  public static final boolean IS_WINDOWS = System.getProperty("os.name").contains("Windows");
   
   private int namingPort;
   private Map<Integer, ProcessHolder> processes = new HashMap<Integer, ProcessHolder>();
@@ -156,6 +157,9 @@ public class ProcessManager {
       "-Dgemfire.disallowMcastDefaults=true",
       "-XX:MaxPermSize=256M",
       "-ea",
+      // use IPv4 on Windows
+      // see https://github.com/belaban/JGroups/wiki/FAQ
+//      (IS_WINDOWS?"-Djava.net.preferIPv4Stack=true":""),
       agent,
       "dunit.standalone.ChildVM"
     };


Mime
View raw message