You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by yu...@apache.org on 2014/02/26 04:54:12 UTC

[2/3] git commit: Fix test failing for clearing commit log directory

Fix test failing for clearing commit log directory


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

Branch: refs/heads/trunk
Commit: 5b6d2e40c85f6f9770c03a22e9b11ea5fb0fbe4c
Parents: d0c3859
Author: Yuki Morishita <yu...@apache.org>
Authored: Tue Feb 25 21:52:16 2014 -0600
Committer: Yuki Morishita <yu...@apache.org>
Committed: Tue Feb 25 21:52:16 2014 -0600

----------------------------------------------------------------------
 .../cassandra/dht/OrderPreservingPartitionerTest.java    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5b6d2e40/test/unit/org/apache/cassandra/dht/OrderPreservingPartitionerTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/dht/OrderPreservingPartitionerTest.java b/test/unit/org/apache/cassandra/dht/OrderPreservingPartitionerTest.java
index 80021fd..e14dec8 100644
--- a/test/unit/org/apache/cassandra/dht/OrderPreservingPartitionerTest.java
+++ b/test/unit/org/apache/cassandra/dht/OrderPreservingPartitionerTest.java
@@ -18,17 +18,24 @@
 */
 package org.apache.cassandra.dht;
 
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 import org.apache.cassandra.SchemaLoader;
 
 public class OrderPreservingPartitionerTest extends PartitionerTestCase<StringToken>
 {
+    @BeforeClass
+    public static void cleanStatesFromPreviousTest()
+    {
+        // Since OrderPreservingPartitioner#describeOwnership tries to read SSTables,
+        // we need to clear data dir to clear garbage from previous test before running tests.
+        SchemaLoader.cleanupAndLeaveDirs();
+    }
+
     public void initPartitioner()
     {
         partitioner = new OrderPreservingPartitioner();
-        // need to clear data dir
-        SchemaLoader.cleanupAndLeaveDirs();
     }
 
     @Test