GEODE-3098: fix flaky test failure
Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/b1f793f5 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/b1f793f5 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/b1f793f5 Branch: refs/heads/feature/GEODE-3109 Commit: b1f793f5280606a0daf838ad465bbeae86101fcf Parents: cc66a1e Author: Darrel Schneider <dschnei...@pivotal.io> Authored: Fri Jun 30 09:32:52 2017 -0700 Committer: Darrel Schneider <dschnei...@pivotal.io> Committed: Fri Jun 30 09:34:50 2017 -0700 ---------------------------------------------------------------------- .../offheap/OffHeapLRURecoveryRegressionTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/geode/blob/b1f793f5/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 dc70fb4..018634d 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 @@ -77,18 +77,18 @@ public class OffHeapLRURecoveryRegressionTest { fail("expected at least 10 offheap values to be recovered but only did " + offHeapObjects); } - if (offHeapObjects > 15) { - // Why "> 15" instead of "== 10"? + if (offHeapObjects == ENTRY_COUNT) { + // Why "== ENTRY_COUNT" instead of "== 10"? // As we recover values we asynchronously notify the resource manager // of how much off-heap memory was consumed. Once it sees we are over // the LRU limit then recovery of values will stop happening. // Since it is async it can allow us to exceed the LRU limit. // So far this test usually sees 10 but sometimes sees 11. - // I allow up to 15 just to prevent intermittent test failures. + // I allow up to ENTRY_COUNT-1 just to prevent intermittent test failures. // We should consider changing this async notification to be sync so // that the limit can not be exceeded. - fail("expected at most 15 offheap values to be recovered but actually did " - + offHeapObjects); + fail("expected at most " + (ENTRY_COUNT - 1) + + " offheap values to be recovered but actually did " + offHeapObjects); } } finally { DiskStore ds = gfc.findDiskStore(DS_NAME);