cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [1/6] cassandra git commit: Fix LeveledCompactionStrategyTest#testMutateLevel
Date Thu, 27 Aug 2015 15:20:57 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.2 27bc7a520 -> 408746c90
  refs/heads/cassandra-3.0 e3baf28b6 -> 9cc489065
  refs/heads/trunk 47886dff3 -> 7ba5845f7


Fix LeveledCompactionStrategyTest#testMutateLevel

patch by yukim; reviewed by ariel for CASSANDRA-9575


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

Branch: refs/heads/cassandra-2.2
Commit: 408746c9032628ecee6522150cd4f5cc642442c6
Parents: 27bc7a5
Author: Yuki Morishita <yukim@apache.org>
Authored: Thu Aug 27 10:14:47 2015 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Thu Aug 27 10:14:47 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                                 | 1 +
 .../db/compaction/LeveledCompactionStrategyTest.java        | 9 +++------
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/408746c9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index ea11489..6cffd18 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.1
+ * Fix LeveledCompactionStrategyTest (CASSANDRA-9757)
  * Fix broken UnbufferedDataOutputStreamPlus.writeUTF (CASSANDRA-10203)
  * (cqlsh) add CLEAR command (CASSANDRA-10086)
  * Support string literals as Role names for compatibility (CASSANDRA-10135)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/408746c9/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
b/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
index 63fd0e7..6b3383e 100644
--- a/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
@@ -255,6 +255,7 @@ public class LeveledCompactionStrategyTest
     @Test
     public void testMutateLevel() throws Exception
     {
+        cfs.disableAutoCompaction();
         ByteBuffer value = ByteBuffer.wrap(new byte[100 * 1024]); // 100 KB value, make it
easy to have multiple files
 
         // Enough data to have a level 1 and 2
@@ -273,17 +274,13 @@ public class LeveledCompactionStrategyTest
             rm.applyUnsafe();
             cfs.forceBlockingFlush();
         }
-        waitForLeveling(cfs);
         cfs.forceBlockingFlush();
         LeveledCompactionStrategy strategy = (LeveledCompactionStrategy) ((WrappingCompactionStrategy)
cfs.getCompactionStrategy()).getWrappedStrategies().get(1);
-        cfs.disableAutoCompaction();
-
-        while(CompactionManager.instance.isCompacting(Arrays.asList(cfs)))
-            Thread.sleep(100);
+        cfs.forceMajorCompaction();
 
         for (SSTableReader s : cfs.getSSTables())
         {
-            assertTrue(s.getSSTableLevel() != 6);
+            assertTrue(s.getSSTableLevel() != 6 && s.getSSTableLevel() > 0);
             strategy.manifest.remove(s);
             s.descriptor.getMetadataSerializer().mutateLevel(s.descriptor, 6);
             s.reloadSSTableMetadata();


Mime
View raw message