geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [30/38] incubator-geode git commit: GEODE-385: fix test race
Date Thu, 15 Oct 2015 21:35:53 GMT
GEODE-385: fix test race

Region expiration was being enabled before the test suspended expiration.
This introduced a race in which the region could be expire destroyed
before the first put happened. Now expiry is suspended before region
expiration is configured.


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

Branch: refs/heads/feature/GEODE-77
Commit: 6c09b04caa55ad298c6cabcc591858f39c5aaaf8
Parents: 48b0c96
Author: Darrel Schneider <dschneider@pivotal.io>
Authored: Tue Oct 6 11:24:48 2015 -0700
Committer: Darrel Schneider <dschneider@pivotal.io>
Committed: Tue Oct 6 11:34:23 2015 -0700

----------------------------------------------------------------------
 .../java/com/gemstone/gemfire/TXExpiryJUnitTest.java | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6c09b04c/gemfire-core/src/test/java/com/gemstone/gemfire/TXExpiryJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/TXExpiryJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/TXExpiryJUnitTest.java
index 2a0a581..867ebb2 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/TXExpiryJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/TXExpiryJUnitTest.java
@@ -318,14 +318,15 @@ public class TXExpiryJUnitTest {
       }
     };
     mutator.addCacheListener(cl);
-    if (useTTL) {
-      mutator.setRegionTimeToLive(exprAtt);
-    } else {
-      mutator.setRegionIdleTimeout(exprAtt);
-    }
-
+    // Suspend before enabling region expiration to prevent
+    // it from happening before we do the put.
+    ExpiryTask.suspendExpiration();
     try {
-      ExpiryTask.suspendExpiration();
+      if (useTTL) {
+        mutator.setRegionTimeToLive(exprAtt);
+      } else {
+        mutator.setRegionIdleTimeout(exprAtt);
+      }
 
       // Create some keys and age them, I wish we could fake/force the age
       // instead of having to actually wait


Mime
View raw message