Fix pessimistic unit tests post-4671 Conflicts: test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/068b53dd Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/068b53dd Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/068b53dd Branch: refs/heads/trunk Commit: 068b53dd5de928fd80815b54963af796f51f1c38 Parents: 9bea226 Author: Sylvain Lebresne <sylv...@datastax.com> Authored: Sat Feb 16 00:21:35 2013 +0100 Committer: Sylvain Lebresne <sylv...@datastax.com> Committed: Wed Feb 20 23:57:45 2013 +0100 ---------------------------------------------------------------------- .../db/compaction/CompactionsPurgeTest.java | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/068b53dd/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java ---------------------------------------------------------------------- diff --git a/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java b/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java index 827257f..ea9763a 100644 --- a/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java +++ b/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java @@ -139,15 +139,15 @@ public class CompactionsPurgeTest extends SchemaLoader cfs.forceBlockingFlush(); cfs.getCompactionStrategy().getUserDefinedTask(sstablesIncomplete, Integer.MAX_VALUE).execute(null); - // verify that minor compaction does not GC when key is present - // in a non-compacted sstable - ColumnFamily cf = cfs.getColumnFamily(QueryFilter.getIdentityFilter(key1, new QueryPath(cfName))); - Assert.assertEquals(10, cf.getColumnCount()); - // verify that minor compaction does GC when key is provably not // present in a non-compacted sstable - cf = cfs.getColumnFamily(QueryFilter.getIdentityFilter(key2, new QueryPath(cfName))); + ColumnFamily cf = cfs.getColumnFamily(QueryFilter.getIdentityFilter(key2, new QueryPath(cfName))); assert cf == null; + + // verify that minor compaction still GC when key is present + // in a non-compacted sstable but the timestamp ensures we won't miss anything + cf = cfs.getColumnFamily(QueryFilter.getIdentityFilter(key1, new QueryPath(cfName))); + Assert.assertEquals(1, cf.getColumnCount()); } @Test @@ -182,7 +182,7 @@ public class CompactionsPurgeTest extends SchemaLoader ColumnFamily cf = cfs.getColumnFamily(QueryFilter.getIdentityFilter(key3, new QueryPath(cfName))); Assert.assertTrue(!cf.getColumn(ByteBufferUtil.bytes("c2")).isLive()); - Assert.assertEquals(1, cf.getColumnCount()); + Assert.assertEquals(2, cf.getColumnCount()); } @Test