geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [geode] branch develop updated: GEODE-2556 RollingUpgradeDUnitTest.testRollServersOnPersistentRegion_dataserializable[0] fails intermittently
Date Tue, 16 Jan 2018 17:57:19 GMT
This is an automated email from the ASF dual-hosted git repository.

bschuchardt 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 511e131  GEODE-2556 RollingUpgradeDUnitTest.testRollServersOnPersistentRegion_dataserializable[0]
fails intermittently
511e131 is described below

commit 511e131af08f5aa622021d0d54791dba54fdc8f5
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
AuthorDate: Tue Jan 16 09:53:28 2018 -0800

    GEODE-2556 RollingUpgradeDUnitTest.testRollServersOnPersistentRegion_dataserializable[0]
fails intermittently
    
    Most of the tests in this class use region shortcuts to create a Region
    but those that use persistent regions were not & were failing to set
    the Scope to DISTRIBUTED_ACK.  To compensate for the use of the default
    DISTRIBUTED_NO_ACK scope the test had a threadSleep() method that paused
    the test for 1/4 second hoping that distribution would finish and verification
    would pass.
    
    I've set the scope to DISTRIBUTED_ACK and have removed the threadSleep()
    method.
---
 .../rollingupgrade/RollingUpgradeDUnitTest.java     | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeDUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeDUnitTest.java
index a666aef..c09613f 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeDUnitTest.java
@@ -260,8 +260,6 @@ public class RollingUpgradeDUnitTest extends JUnit4DistributedTestCase
{
       putter.invoke(invokePut(regionName, "" + i, "VALUE(" + i + ")"));
     }
 
-    threadSleep();
-
     // verify present in others
     for (VM vm : vms) {
       vm.invoke(invokeAssertEntriesEqual(regionName, start, end));
@@ -274,8 +272,6 @@ public class RollingUpgradeDUnitTest extends JUnit4DistributedTestCase
{
       putter.invoke(invokePut(regionName, "" + i, new Properties()));
     }
 
-    threadSleep();
-
     // verify present in others
     for (VM vm : vms) {
       vm.invoke(invokeAssertEntriesExist(regionName, start, end));
@@ -292,8 +288,6 @@ public class RollingUpgradeDUnitTest extends JUnit4DistributedTestCase
{
       putter.invoke(invokePut(regionName, "" + i, testDataSerializable));
     }
 
-    threadSleep();
-
     // verify present in others
     for (VM vm : vms) {
       vm.invoke(invokeAssertEntriesExist(regionName, start, end));
@@ -301,7 +295,6 @@ public class RollingUpgradeDUnitTest extends JUnit4DistributedTestCase
{
   }
 
   private void verifyValues(String objectType, String regionName, int start, int end, VM...
vms) {
-    threadSleep();
     if (objectType.equals("strings")) {
       for (VM vm : vms) {
         vm.invoke(invokeAssertEntriesEqual(regionName, start, end));
@@ -317,16 +310,6 @@ public class RollingUpgradeDUnitTest extends JUnit4DistributedTestCase
{
     }
   }
 
-  // Oddly the puts will return and for some reason the other vms have yet to recieve or
process the
-  // put?
-  private void threadSleep() {
-    try {
-      Thread.sleep(250);
-    } catch (InterruptedException e) {
-      Thread.currentThread().interrupt();
-    }
-  }
-
   private void query(String queryString, int numExpectedResults, VM... vms) {
     for (VM vm : vms) {
       vm.invoke(invokeAssertQueryResults(queryString, numExpectedResults));
@@ -889,6 +872,9 @@ public class RollingUpgradeDUnitTest extends JUnit4DistributedTestCase
{
     Class dataPolicyObject = Thread.currentThread().getContextClassLoader()
         .loadClass("org.apache.geode.cache.DataPolicy");
     Object dataPolicy = dataPolicyObject.getField("PERSISTENT_REPLICATE").get(null);
+    Class scopeClass =
+        Thread.currentThread().getContextClassLoader().loadClass("org.apache.geode.cache.Scope");
+    Object scope = scopeClass.getField("DISTRIBUTED_ACK").get(null);
     if (store == null) {
       Object dsf = cache.getClass().getMethod("createDiskStoreFactory").invoke(cache);
       dsf.getClass().getMethod("setMaxOplogSize", long.class).invoke(dsf, 1L);
@@ -899,6 +885,7 @@ public class RollingUpgradeDUnitTest extends JUnit4DistributedTestCase
{
     Object rf = cache.getClass().getMethod("createRegionFactory").invoke(cache);
     rf.getClass().getMethod("setDiskStoreName", String.class).invoke(rf, "store");
     rf.getClass().getMethod("setDataPolicy", dataPolicy.getClass()).invoke(rf, dataPolicy);
+    rf.getClass().getMethod("setScope", scope.getClass()).invoke(rf, scope);
     rf.getClass().getMethod("create", String.class).invoke(rf, regionName);
   }
 

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

Mime
View raw message