You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2013/11/27 18:35:30 UTC

git commit: don't leave replaced SSTRs around to break other tests patch by Tyler Hobbs

Updated Branches:
  refs/heads/trunk bb60ad35b -> 7ea5b40b7


don't leave replaced SSTRs around to break other tests
patch by Tyler Hobbs


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

Branch: refs/heads/trunk
Commit: 7ea5b40b7172ec9f3fdecca533e19d8a165de7df
Parents: bb60ad3
Author: Jonathan Ellis <jb...@apache.org>
Authored: Wed Nov 27 11:35:12 2013 -0600
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Wed Nov 27 11:35:21 2013 -0600

----------------------------------------------------------------------
 .../apache/cassandra/io/sstable/IndexSummaryManagerTest.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7ea5b40b/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 aac70ec..4b4c562 100644
--- a/test/unit/org/apache/cassandra/io/sstable/IndexSummaryManagerTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/IndexSummaryManagerTest.java
@@ -253,8 +253,9 @@ public class IndexSummaryManagerTest extends SchemaLoader
 
         List<SSTableReader> sstables = new ArrayList<>(cfs.getSSTables());
         assertEquals(1, sstables.size());
-        SSTableReader sstable = sstables.get(0);
+        SSTableReader original = sstables.get(0);
 
+        SSTableReader sstable = original;
         for (int samplingLevel = MIN_SAMPLING_LEVEL; samplingLevel < BASE_SAMPLING_LEVEL; samplingLevel++)
         {
             sstable = sstable.cloneWithNewSummarySamplingLevel(samplingLevel);
@@ -262,6 +263,9 @@ public class IndexSummaryManagerTest extends SchemaLoader
             int expectedSize = (numRows * samplingLevel) / (sstable.metadata.getIndexInterval() * BASE_SAMPLING_LEVEL);
             assertEquals(expectedSize, sstable.getIndexSummarySize(), 1);
         }
+
+        // don't leave replaced SSTRs around to break other tests
+        cfs.getDataTracker().replaceReaders(Collections.singleton(original), Collections.singleton(sstable));
     }
 
     @Test