Permalink
Browse files

ISPN-2521 Prevent test timing issues from affecting result of JdbcBin…

…aryCacheStoreTest.testPurgeExpiredAllCodepaths()
  • Loading branch information...
tristantarrant authored and galderz committed Dec 18, 2012
1 parent 9d70f50 commit f3248427b9310613afe6ba297ea29d190a595f86
@@ -93,14 +93,14 @@ public void testPurgeExpiredAllCodepaths() throws Exception {
FixedHashKey k1 = new FixedHashKey(1, "a");
FixedHashKey k2 = new FixedHashKey(1, "b");
cs.store(TestInternalCacheEntryFactory.create(k1, "value"));
- cs.store(TestInternalCacheEntryFactory.create(k2, "value", 5000)); // will expire
+ cs.store(TestInternalCacheEntryFactory.create(k2, "value", 1000)); // will expire
for (int i = 0; i < 120; i++) {
cs.store(TestInternalCacheEntryFactory.create(new FixedHashKey(i + 10, "non-exp k" + i), "value"));
- cs.store(TestInternalCacheEntryFactory.create(new FixedHashKey(i + 10, "exp k" + i), "value", 5000)); // will expire
+ cs.store(TestInternalCacheEntryFactory.create(new FixedHashKey(i + 10, "exp k" + i), "value", 1000)); // will expire
}
+ TestingUtil.sleepThread(1000);
assert cs.containsKey(k1);
- assert cs.containsKey(k2);
- TestingUtil.sleepThread(6000);
+ assert !cs.containsKey(k2);
cs.purgeExpired();
assert cs.containsKey(k1);
assert !cs.containsKey(k2);

0 comments on commit f324842

Please sign in to comment.