geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject geode git commit: fixed unit test
Date Wed, 12 Apr 2017 18:44:48 GMT
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-2097 9ade788cf -> 0798883a2


fixed unit test


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

Branch: refs/heads/feature/GEODE-2097
Commit: 0798883a2297b0599ca5b52bfd2089a510ebdd44
Parents: 9ade788
Author: Darrel Schneider <dschneider@pivotal.io>
Authored: Wed Apr 12 11:42:42 2017 -0700
Committer: Darrel Schneider <dschneider@pivotal.io>
Committed: Wed Apr 12 11:42:42 2017 -0700

----------------------------------------------------------------------
 .../internal/offheap/OffHeapLRURecoveryRegressionTest.java  | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/0798883a/geode-core/src/test/java/org/apache/geode/internal/offheap/OffHeapLRURecoveryRegressionTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/offheap/OffHeapLRURecoveryRegressionTest.java
b/geode-core/src/test/java/org/apache/geode/internal/offheap/OffHeapLRURecoveryRegressionTest.java
index f23ea95..489c62b 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/offheap/OffHeapLRURecoveryRegressionTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/offheap/OffHeapLRURecoveryRegressionTest.java
@@ -49,7 +49,7 @@ public class OffHeapLRURecoveryRegressionTest {
   @Test
   public void recoveringTooMuchDataDoesNotRunOutOfOffHeapMemory() {
     final int ENTRY_COUNT = 40;
-    long expectedUsedMemory;
+    final int expectedObjectCount;
     GemFireCacheImpl gfc = createCache();
     try {
       Region<Object, Object> r = createRegion(gfc);
@@ -57,7 +57,9 @@ public class OffHeapLRURecoveryRegressionTest {
       for (int i = 0; i < ENTRY_COUNT; i++) {
         r.put(i, v);
       }
-      expectedUsedMemory = MemoryAllocatorImpl.getAllocator().getUsedMemory();
+      // expect one more during recovery because of the way the LRU limit is
+      // enforced during recover.
+      expectedObjectCount = MemoryAllocatorImpl.getAllocator().getStats().getObjects() +
1;
     } finally {
       gfc.close();
     }
@@ -69,7 +71,8 @@ public class OffHeapLRURecoveryRegressionTest {
         Region<Object, Object> r = createRegion(gfc);
         try {
           assertEquals(ENTRY_COUNT, r.size());
-          assertEquals(expectedUsedMemory, MemoryAllocatorImpl.getAllocator().getUsedMemory());
+          assertEquals(expectedObjectCount,
+              MemoryAllocatorImpl.getAllocator().getStats().getObjects());
         } finally {
           r.destroyRegion();
           DiskStore ds = gfc.findDiskStore(DS_NAME);


Mime
View raw message