cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bened...@apache.org
Subject [1/3] cassandra git commit: ninja fix IndexSummaryManagerTest.testCompactionsRace
Date Wed, 18 Mar 2015 15:04:55 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 521b36311 -> accbfa7ac
  refs/heads/trunk abd528a0f -> 07cad8e8d


ninja fix IndexSummaryManagerTest.testCompactionsRace

patch by benedict; reviewed by tjake for CASSANDRA-8981


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

Branch: refs/heads/cassandra-2.1
Commit: accbfa7ac1843cdb47d5816772e8a7a3348097db
Parents: 521b363
Author: Benedict Elliott Smith <benedict@apache.org>
Authored: Wed Mar 18 15:04:10 2015 +0000
Committer: Benedict Elliott Smith <benedict@apache.org>
Committed: Wed Mar 18 15:04:10 2015 +0000

----------------------------------------------------------------------
 .../cassandra/io/sstable/IndexSummaryManagerTest.java  | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/accbfa7a/test/unit/org/apache/cassandra/io/sstable/IndexSummaryManagerTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/IndexSummaryManagerTest.java b/test/unit/org/apache/cassandra/io/sstable/IndexSummaryManagerTest.java
index dec7705..877b6e6 100644
--- a/test/unit/org/apache/cassandra/io/sstable/IndexSummaryManagerTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/IndexSummaryManagerTest.java
@@ -508,8 +508,8 @@ public class IndexSummaryManagerTest extends SchemaLoader
         String cfname = "StandardRace"; // index interval of 8, no key caching
         Keyspace keyspace = Keyspace.open(ksname);
         ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(cfname);
-        int numSSTables = 20;
-        int numRows = 28;
+        int numSSTables = 50;
+        int numRows = 1 << 10;
         createSSTables(ksname, cfname, numSSTables, numRows);
 
         List<SSTableReader> sstables = new ArrayList<>(cfs.getSSTables());
@@ -530,7 +530,8 @@ public class IndexSummaryManagerTest extends SchemaLoader
                         try
                         {
                             IndexSummaryManager.instance.redistributeSummaries();
-                        } catch (Throwable e)
+                        }
+                        catch (Throwable e)
                         {
                             failed.set(true);
                         }
@@ -544,14 +545,14 @@ public class IndexSummaryManagerTest extends SchemaLoader
 
         try
         {
-            Assert.assertFalse(failed.get());
+            Assert.assertFalse(failed.getAndSet(true));
 
             for (SSTableReader sstable : sstables)
             {
                 Assert.assertEquals(true, sstable.isMarkedCompacted());
             }
 
-            Assert.assertEquals(20, sstables.size());
+            Assert.assertEquals(numSSTables, sstables.size());
 
             try
             {
@@ -567,5 +568,7 @@ public class IndexSummaryManagerTest extends SchemaLoader
             tp.shutdownNow();
             CompactionManager.instance.finishCompactionsAndShutdown(10, TimeUnit.SECONDS);
         }
+
+        cfs.truncateBlocking();
     }
 }


Mime
View raw message