You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2015/07/29 19:09:19 UTC

cassandra git commit: Fix AntiCompactionTest.antiCompactionSizeTest

Repository: cassandra
Updated Branches:
  refs/heads/trunk 85c6b2edb -> eca7cbb2e


Fix AntiCompactionTest.antiCompactionSizeTest

relax AntiCompactionTest.antiCompactionSizeTest so the sizes don't have to be
as close, but also verify that the row count doesn't change.

patch by Ariel Weisberg; reviewed by Aleksey Yeschenko


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

Branch: refs/heads/trunk
Commit: eca7cbb2e20858625c39cf0f9a5a76c6cc905dc0
Parents: 85c6b2e
Author: Ariel Weisberg <ar...@weisberg.ws>
Authored: Tue Jul 28 14:45:21 2015 -0400
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Jul 29 20:07:57 2015 +0300

----------------------------------------------------------------------
 .../apache/cassandra/db/compaction/AntiCompactionTest.java  | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/eca7cbb2/test/unit/org/apache/cassandra/db/compaction/AntiCompactionTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/compaction/AntiCompactionTest.java b/test/unit/org/apache/cassandra/db/compaction/AntiCompactionTest.java
index b85c5ec..73baeeb 100644
--- a/test/unit/org/apache/cassandra/db/compaction/AntiCompactionTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/AntiCompactionTest.java
@@ -149,10 +149,15 @@ public class AntiCompactionTest
             CompactionManager.instance.performAnticompaction(cfs, Arrays.asList(range), refs, txn, 12345);
         }
         long sum = 0;
+        long rows = 0;
         for (SSTableReader x : cfs.getLiveSSTables())
+        {
             sum += x.bytesOnDisk();
+            rows += x.getTotalRows();
+        }
         assertEquals(sum, cfs.metric.liveDiskSpaceUsed.getCount());
-        assertEquals(origSize, cfs.metric.liveDiskSpaceUsed.getCount(), 100000);
+        assertEquals(rows, 1000 * (1000 * 5));//See writeFile for how this number is derived
+        assertEquals(origSize, cfs.metric.liveDiskSpaceUsed.getCount(), 16000000);
     }
 
     private SSTableReader writeFile(ColumnFamilyStore cfs, int count)
@@ -293,7 +298,7 @@ public class AntiCompactionTest
         }
         Collection<SSTableReader> sstables = getUnrepairedSSTables(store);
         assertEquals(store.getLiveSSTables().size(), sstables.size());
-        
+
         Range<Token> range = new Range<Token>(new BytesToken("-10".getBytes()), new BytesToken("-1".getBytes()));
         List<Range<Token>> ranges = Arrays.asList(range);