You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2015/10/06 20:34:37 UTC

incubator-geode git commit: GEODE-385: fix test race

Repository: incubator-geode
Updated Branches:
  refs/heads/develop 48b0c9612 -> 6c09b04ca


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/develop
Commit: 6c09b04caa55ad298c6cabcc591858f39c5aaaf8
Parents: 48b0c96
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Tue Oct 6 11:24:48 2015 -0700
Committer: Darrel Schneider <ds...@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