cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject git commit: Fix pessimistic unit tests post-4671
Date Fri, 15 Feb 2013 23:21:43 GMT
Updated Branches:
  refs/heads/trunk 876d313f4 -> 7bc8b02c8


Fix pessimistic unit tests post-4671


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/7bc8b02c
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7bc8b02c
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7bc8b02c

Branch: refs/heads/trunk
Commit: 7bc8b02c83d34e8c2074bc2d97ac8ea91864348a
Parents: 876d313
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Sat Feb 16 00:21:35 2013 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Sat Feb 16 00:21:35 2013 +0100

----------------------------------------------------------------------
 .../db/compaction/CompactionsPurgeTest.java        |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7bc8b02c/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 7511002..6bc6e8b 100644
--- a/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java
@@ -137,15 +137,15 @@ public class CompactionsPurgeTest extends SchemaLoader
         cfs.forceBlockingFlush();
         new CompactionTask(cfs, 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, 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, cfName));
+        ColumnFamily cf = cfs.getColumnFamily(QueryFilter.getIdentityFilter(key2, 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, cfName));
+        Assert.assertEquals(1, cf.getColumnCount());
     }
 
     @Test
@@ -180,7 +180,7 @@ public class CompactionsPurgeTest extends SchemaLoader
 
         ColumnFamily cf = cfs.getColumnFamily(QueryFilter.getIdentityFilter(key3, cfName));
         Assert.assertTrue(!cf.getColumn(ByteBufferUtil.bytes("c2")).isLive());
-        Assert.assertEquals(1, cf.getColumnCount());
+        Assert.assertEquals(2, cf.getColumnCount());
     }
 
     @Test


Mime
View raw message