GEODE-518: fix failure caused by stopped DSClock
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/defe6491 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/defe6491 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/defe6491 Branch: refs/heads/feature/GEODE-77 Commit: defe649197351a382aa48e39b97365d3e9087d75 Parents: 33cb42b Author: Darrel Schneider <[email protected]> Authored: Tue Nov 3 11:11:18 2015 -0800 Committer: Darrel Schneider <[email protected]> Committed: Tue Nov 3 11:11:18 2015 -0800 ---------------------------------------------------------------------- .../gemstone/gemfire/distributed/internal/DSClock.java | 2 +- .../gemstone/gemfire/cache30/MultiVMRegionTestCase.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/defe6491/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/DSClock.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/DSClock.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/DSClock.java index 7695fd1..8160ea8 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/DSClock.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/DSClock.java @@ -223,7 +223,7 @@ public class DSClock { } } - private long getStopTime() { + public long getStopTime() { return this.suspendedTime.get(); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/defe6491/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 6fada2b..4beba1a 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 @@ -87,6 +87,7 @@ import com.gemstone.gemfire.cache.partition.PartitionRegionHelper; import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.cache.util.CacheListenerAdapter; import com.gemstone.gemfire.distributed.internal.DMStats; +import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember; import com.gemstone.gemfire.internal.AvailablePortHelper; import com.gemstone.gemfire.internal.HeapDataOutputStream; @@ -3998,6 +3999,13 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase { final boolean mirrored = getRegionAttributes().getDataPolicy().withReplication(); final boolean partitioned = getRegionAttributes().getPartitionAttributes() != null || getRegionAttributes().getDataPolicy().withPartitioning(); + if (!mirrored) { + // This test fails intermittently because the DSClock we inherit from the existing + // distributed system is stuck in the "stopped" state. + // The DSClock is going away when java groups is merged and at that + // time this following can be removed. + disconnectAllFromDS(); + } final String name = this.getUniqueName(); final int timeout = 10; // ms @@ -4102,7 +4110,8 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase { if (re != null) { EntryExpiryTask eet = getEntryExpiryTask(region, key); if (eet != null) { - logger.info("DEBUG: waiting for expire destroy expirationTime= " + eet.getExpirationTime() + " now=" + eet.getNow() + " currentTimeMillis=" + System.currentTimeMillis()); + long stopTime = ((InternalDistributedSystem)(region.getCache().getDistributedSystem())).getClock().getStopTime(); + logger.info("DEBUG: waiting for expire destroy expirationTime= " + eet.getExpirationTime() + " now=" + eet.getNow() + " stopTime=" + stopTime + " currentTimeMillis=" + System.currentTimeMillis()); } else { logger.info("DEBUG: waiting for expire destroy but expiry task is null"); }
