Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 bef1d0cb0 -> 2d1e46e40 refs/heads/trunk b2dfe1be9 -> 787a20fdd
Fixing LongCompactionsTest Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e7d802e3 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e7d802e3 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e7d802e3 Branch: refs/heads/cassandra-2.1 Commit: e7d802e35976d41979d77978da7d70e4f30b630a Parents: 6ee0c75 Author: Carl Yeksigian <c...@apache.org> Authored: Tue Mar 3 11:17:30 2015 -0500 Committer: Yuki Morishita <yu...@apache.org> Committed: Tue Mar 3 16:36:39 2015 -0600 ---------------------------------------------------------------------- .../cassandra/db/compaction/LongCompactionsTest.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e7d802e3/test/long/org/apache/cassandra/db/compaction/LongCompactionsTest.java ---------------------------------------------------------------------- diff --git a/test/long/org/apache/cassandra/db/compaction/LongCompactionsTest.java b/test/long/org/apache/cassandra/db/compaction/LongCompactionsTest.java index 21c6457..a21cee5 100644 --- a/test/long/org/apache/cassandra/db/compaction/LongCompactionsTest.java +++ b/test/long/org/apache/cassandra/db/compaction/LongCompactionsTest.java @@ -24,22 +24,31 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import org.apache.cassandra.config.Schema; +import org.junit.Before; import org.junit.Test; + import org.apache.cassandra.SchemaLoader; import org.apache.cassandra.Util; +import org.apache.cassandra.config.Schema; import org.apache.cassandra.db.*; import org.apache.cassandra.io.sstable.SSTableReader; import org.apache.cassandra.io.sstable.SSTableUtils; import org.apache.cassandra.utils.ByteBufferUtil; import org.apache.cassandra.utils.FBUtilities; - import static org.junit.Assert.assertEquals; public class LongCompactionsTest extends SchemaLoader { public static final String KEYSPACE1 = "Keyspace1"; + @Before + public void cleanupFiles() + { + Keyspace keyspace = Keyspace.open(KEYSPACE1); + ColumnFamilyStore cfs = keyspace.getColumnFamilyStore("Standard1"); + cfs.truncateBlocking(); + } + /** * Test compaction with a very wide row. */ @@ -99,6 +108,7 @@ public class LongCompactionsTest extends SchemaLoader long start = System.nanoTime(); final int gcBefore = (int) (System.currentTimeMillis() / 1000) - Schema.instance.getCFMetaData(KEYSPACE1, "Standard1").getGcGraceSeconds(); + assert store.getDataTracker().markCompacting(sstables): "Cannot markCompacting all sstables"; new CompactionTask(store, sstables, gcBefore).execute(null); System.out.println(String.format("%s: sstables=%d rowsper=%d colsper=%d: %d ms", this.getClass().getName(),