Repository: cassandra Updated Branches: refs/heads/trunk cd1a6beda -> d9e9c948d
Fix KeyCacheTest on Windows (regression from 8099) Patch by pmotta; reviewed by jmckenzie for CASSANDRA-10033 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/67269f69 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/67269f69 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/67269f69 Branch: refs/heads/trunk Commit: 67269f6992737f206e1257a83d33f7d7217cadbd Parents: d054181 Author: Paulo Motta <[email protected]> Authored: Tue Aug 11 13:06:01 2015 -0400 Committer: Joshua McKenzie <[email protected]> Committed: Tue Aug 11 13:06:01 2015 -0400 ---------------------------------------------------------------------- test/unit/org/apache/cassandra/db/KeyCacheTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/67269f69/test/unit/org/apache/cassandra/db/KeyCacheTest.java ---------------------------------------------------------------------- diff --git a/test/unit/org/apache/cassandra/db/KeyCacheTest.java b/test/unit/org/apache/cassandra/db/KeyCacheTest.java index 2508800..30812d2 100644 --- a/test/unit/org/apache/cassandra/db/KeyCacheTest.java +++ b/test/unit/org/apache/cassandra/db/KeyCacheTest.java @@ -34,6 +34,7 @@ import org.apache.cassandra.Util; import org.apache.cassandra.cache.KeyCacheKey; import org.apache.cassandra.concurrent.ScheduledExecutors; import org.apache.cassandra.config.CFMetaData; +import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.config.Schema; import org.apache.cassandra.db.compaction.CompactionManager; import org.apache.cassandra.exceptions.ConfigurationException; @@ -153,10 +154,12 @@ public class KeyCacheTest throw new IllegalStateException(); Util.compactAll(cfs, Integer.MAX_VALUE).get(); + boolean noEarlyOpen = DatabaseDescriptor.getSSTablePreempiveOpenIntervalInMB() < 0; + // after compaction cache should have entries for new SSTables, // but since we have kept a reference to the old sstables, // if we had 2 keys in cache previously it should become 4 - assertKeyCacheSize(4, KEYSPACE1, COLUMN_FAMILY1); + assertKeyCacheSize(noEarlyOpen ? 2 : 4, KEYSPACE1, COLUMN_FAMILY1); refs.release(); @@ -172,7 +175,7 @@ public class KeyCacheTest Util.getAll(Util.cmd(cfs, "key1").build()); Util.getAll(Util.cmd(cfs, "key2").build()); - assertKeyCacheSize(2, KEYSPACE1, COLUMN_FAMILY1); + assertKeyCacheSize(noEarlyOpen ? 4 : 2, KEYSPACE1, COLUMN_FAMILY1); } private static void readData(String keyspace, String columnFamily, int numberOfRows)
