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/26 19:28:29 UTC

[06/50] [abbrv] incubator-geode git commit: GEODE-450: fix race in unit test

GEODE-450: fix race in unit test

The test now waits 30 seconds instead of 3.
Also when it fails it will print info about when it
thought the entry that is not expiring is scheduled to expire.


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

Branch: refs/heads/develop
Commit: a23c33c71228f3104abb81d73fad8bf031600657
Parents: f8935b3
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Tue Oct 20 14:33:07 2015 -0700
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Tue Oct 20 14:33:07 2015 -0700

----------------------------------------------------------------------
 .../gemfire/cache30/MultiVMRegionTestCase.java        | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a23c33c7/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
index b6ba865..e9a8e29 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
@@ -4090,10 +4090,20 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
                   return region.getEntry(key) == null;
                 }
                 public String description() {
-                  return "Entry for key " + key + " never expired (since it still exists)";
+                  LocalRegion lr = (LocalRegion) region;
+                  String expiryInfo = "";
+                  try {
+                    EntryExpiryTask eet = lr.getEntryExpiryTask(key);
+                    if (eet != null) {
+                      expiryInfo = "expirationTime= " + eet.getExpirationTime() + " now=" + eet.getNow();
+                    }
+                  } catch (EntryNotFoundException ex) {
+                    expiryInfo ="EntryNotFoundException when getting expiry task";
+                  }
+                  return "Entry for key " + key + " never expired (since it still exists) " + expiryInfo;
                 }
               };
-              DistributedTestCase.waitForCriterion(waitForUpdate, 3000, 1, true);
+              DistributedTestCase.waitForCriterion(waitForUpdate, 30000, 1, true);
             }
             assertNull(region.getEntry(key));
           }