geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject incubator-geode git commit: GEODE-128: fix expiration tests to run faster with PR regions
Date Thu, 16 Jul 2015 18:49:17 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 3426939e6 -> 93a69f074


GEODE-128: fix expiration tests to run faster with PR regions

Slowdown was caused by the test hook EXPIRY_UNITS_MS not being set
to true on a BucketRegion. BucketRegion does all the expiration on
a PR. The test was setting it on the bucket's parent but not no the
bucket itself. Bucket's now defer to their parent when initializing
this final field.


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

Branch: refs/heads/develop
Commit: 93a69f074783474d9a7b5a18e5eb03a665fe294f
Parents: 3426939
Author: Darrel Schneider <dschneider@pivotal.io>
Authored: Wed Jul 15 17:06:48 2015 -0700
Committer: Darrel Schneider <dschneider@pivotal.io>
Committed: Thu Jul 16 11:44:36 2015 -0700

----------------------------------------------------------------------
 .../gemstone/gemfire/internal/cache/LocalRegion.java   |  5 ++++-
 .../com/gemstone/gemfire/cache30/RegionTestCase.java   | 13 +++++++------
 2 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/93a69f07/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
index 02becb9..eab46ab 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
@@ -335,7 +335,7 @@ public class LocalRegion extends AbstractRegion
    *
    * @since 5.0
    */
-  final boolean EXPIRY_UNITS_MS = Boolean.getBoolean(EXPIRY_MS_PROPERTY);
+  final boolean EXPIRY_UNITS_MS;
 
   // Indicates that the entries are in fact initialized. It turns out
   // you can't trust the assignment of a volatile (as indicated above)
@@ -590,6 +590,9 @@ public class LocalRegion extends AbstractRegion
       LocalRegion parentRegion, GemFireCacheImpl cache,
       InternalRegionArguments internalRegionArgs) throws DiskAccessException {
     super(cache, attrs,regionName, internalRegionArgs);
+    // Initialized here (and defers to parent) to fix GEODE-128
+    this.EXPIRY_UNITS_MS = parentRegion != null ? parentRegion.EXPIRY_UNITS_MS : Boolean.getBoolean(EXPIRY_MS_PROPERTY);
+
     Assert.assertTrue(regionName != null, "regionName must not be null");
     this.sharedDataView = buildDataView();
     this.regionName = regionName;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/93a69f07/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
index 8b22db8..091d250 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
@@ -1963,6 +1963,7 @@ public abstract class RegionTestCase extends CacheTestCase {
     // After the timeout passes, we will tolerate a slight
     // lag before the invalidate becomes visible (due to
     // system loading)
+    // Slight lag? WAIT_DEFAULT is 60,000 ms. Many of our tests configure 20ms expiration.
     final int maxWaitTime = Integer.getInteger(WAIT_PROPERTY, WAIT_DEFAULT).intValue();
     tilt += maxWaitTime;
     for (;;) {
@@ -1971,7 +1972,7 @@ public abstract class RegionTestCase extends CacheTestCase {
         if (fetchEntryValue(entry) == null) break;
         fail("Entry failed to invalidate");
       }
-      pause(1000);
+      pause(100);
     }
   }
 
@@ -2028,7 +2029,7 @@ public abstract class RegionTestCase extends CacheTestCase {
         break;
       Assert.assertTrue(System.currentTimeMillis() <= tilt,
           "Entry failed to destroy");
-      pause(1000);
+      pause(100);
     }
   }
   
@@ -2072,7 +2073,7 @@ public abstract class RegionTestCase extends CacheTestCase {
         break;
       Assert.assertTrue(System.currentTimeMillis() <= tilt,
           "Region failed to destroy");
-      pause(1000);
+      pause(100);
     }
   }  
 
@@ -2144,9 +2145,9 @@ public abstract class RegionTestCase extends CacheTestCase {
 
     Region region = null;
     /**
-             * Crank up the expiration so test runs faster.
-             * This property only needs to be set while the region is created
-             */
+     * Crank up the expiration so test runs faster.
+     * This property only needs to be set while the region is created
+     */
     System.setProperty(LocalRegion.EXPIRY_MS_PROPERTY, "true");
     try {
       region = createRegion(name, attrs);


Mime
View raw message