geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bogle...@apache.org
Subject [geode] branch develop updated: GEODE-3316: Modified tests to roll locator and server
Date Wed, 06 Sep 2017 18:02:25 GMT
This is an automated email from the ASF dual-hosted git repository.

boglesby pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 841d4e9  GEODE-3316: Modified tests to roll locator and server
841d4e9 is described below

commit 841d4e9031d3336c6c4d4f541088a46ddd7faae2
Author: Barry Oglesby <boglesby@pivotal.io>
AuthorDate: Tue Sep 5 16:25:48 2017 -0700

    GEODE-3316: Modified tests to roll locator and server
---
 .../cache/wan/WANRollingUpgradeDUnitTest.java      | 44 +++++++++++++++++++++-
 1 file changed, 42 insertions(+), 2 deletions(-)

diff --git a/geode-wan/src/test/java/org/apache/geode/cache/wan/WANRollingUpgradeDUnitTest.java
b/geode-wan/src/test/java/org/apache/geode/cache/wan/WANRollingUpgradeDUnitTest.java
index 58a5e18..045c4d2 100644
--- a/geode-wan/src/test/java/org/apache/geode/cache/wan/WANRollingUpgradeDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/cache/wan/WANRollingUpgradeDUnitTest.java
@@ -28,8 +28,10 @@ import org.apache.geode.cache.server.CacheServer;
 import org.apache.geode.cache.util.CacheListenerAdapter;
 import org.apache.geode.distributed.Locator;
 import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.InternalLocator;
 import org.apache.geode.internal.AvailablePort;
 import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.internal.Version;
 import org.apache.geode.internal.cache.wan.AbstractGatewaySender;
 import org.apache.geode.internal.cache.wan.parallel.BatchRemovalThreadHelper;
 import org.apache.geode.internal.cache.wan.parallel.ConcurrentParallelGatewaySenderQueue;
@@ -376,7 +378,7 @@ public class WANRollingUpgradeDUnitTest extends JUnit4CacheTestCase {
     // Get mixed site members
     VM site1Locator = host.getVM(oldVersion, 0);
     VM site1Server1 = host.getVM(oldVersion, 1);
-    VM site1Server2 = host.getVM(2);
+    VM site1Server2 = host.getVM(oldVersion, 2);
     VM site1Client = host.getVM(oldVersion, 3);
 
     // Get old site members
@@ -411,6 +413,14 @@ public class WANRollingUpgradeDUnitTest extends JUnit4CacheTestCase {
     startAndConfigureServers(site1Server1, site1Server2, site1Locators, site2DistributedSystemId,
         regionName, site1SenderId, ParallelGatewaySenderQueue.DEFAULT_MESSAGE_SYNC_INTERVAL);
 
+    // Roll mixed site locator to current
+    rollLocatorToCurrent(site1Locator, site1LocatorPort, site1DistributedSystemId, site1Locators,
+        site2Locators);
+
+    // Roll one mixed site server to current
+    rollStartAndConfigureServerToCurrent(site1Server2, site1Locators, site2DistributedSystemId,
+        regionName, site1SenderId, ParallelGatewaySenderQueue.DEFAULT_MESSAGE_SYNC_INTERVAL);
+
     // Start and configure old site servers
     String site2SenderId = getName() + "_gatewaysender_" + site1DistributedSystemId;
     startAndConfigureServers(site2Server1, site2Server2, site2Locators, site1DistributedSystemId,
@@ -429,7 +439,7 @@ public class WANRollingUpgradeDUnitTest extends JUnit4CacheTestCase {
     // Get mixed site members
     VM site1Locator = host.getVM(oldVersion, 0);
     VM site1Server1 = host.getVM(oldVersion, 1);
-    VM site1Server2 = host.getVM(2);
+    VM site1Server2 = host.getVM(oldVersion, 2);
     VM site1Client = host.getVM(oldVersion, 3);
 
     // Get old site members
@@ -464,6 +474,14 @@ public class WANRollingUpgradeDUnitTest extends JUnit4CacheTestCase {
     startAndConfigureServers(site1Server1, site1Server2, site1Locators, site2DistributedSystemId,
         regionName, site1SenderId, ParallelGatewaySenderQueue.DEFAULT_MESSAGE_SYNC_INTERVAL);
 
+    // Roll mixed site locator to current
+    rollLocatorToCurrent(site1Locator, site1LocatorPort, site1DistributedSystemId, site1Locators,
+        site2Locators);
+
+    // Roll one mixed site server to current
+    rollStartAndConfigureServerToCurrent(site1Server2, site1Locators, site2DistributedSystemId,
+        regionName, site1SenderId, ParallelGatewaySenderQueue.DEFAULT_MESSAGE_SYNC_INTERVAL);
+
     // Start and configure old site servers
     String site2SenderId = getName() + "_gatewaysender_" + site1DistributedSystemId;
     startAndConfigureServers(site2Server1, site2Server2, site2Locators, site1DistributedSystemId,
@@ -488,6 +506,28 @@ public class WANRollingUpgradeDUnitTest extends JUnit4CacheTestCase {
     Locator.startLocatorAndDS(port, null, props);
   }
 
+  private void stopLocator() throws Exception {
+    InternalLocator.getLocator().stop();
+  }
+
+  private VM rollLocatorToCurrent(VM rollLocator, int port, int distributedSystemId,
+      String locators, String remoteLocators) throws Exception {
+    rollLocator.invoke(() -> stopLocator());
+    VM newLocator = Host.getHost(0).getVM(rollLocator.getPid());
+    newLocator.invoke(() -> startLocator(port, distributedSystemId, locators, remoteLocators));
+    return newLocator;
+  }
+
+  private VM rollStartAndConfigureServerToCurrent(VM oldServer, String locators,
+      int distributedSystem, String regionName, String senderId, int messageSyncInterval)
+      throws Exception {
+    oldServer.invoke(() -> closeCache());
+    VM rollServer = Host.getHost(0).getVM(oldServer.getPid());
+    startAndConfigureServers(rollServer, null, locators, distributedSystem, regionName, senderId,
+        messageSyncInterval);
+    return rollServer;
+  }
+
   private void startAndConfigureServers(VM server1, VM server2, String locators,
       int distributedSystem, String regionName, String senderId, int messageSyncInterval)
{
     // Start and configure servers

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message