cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcken...@apache.org
Subject cassandra git commit: Fix SSTableRewriterTest on Windows
Date Wed, 14 Jan 2015 17:37:40 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 88b51539f -> 2fc9f3292


Fix SSTableRewriterTest on Windows

Patch by jmckenzie; reviewed by marcuse for CASSANDRA-8598


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

Branch: refs/heads/trunk
Commit: 2fc9f3292a7e7164662ad50617fe76a21e697395
Parents: 88b5153
Author: Joshua McKenzie <jmckenzie@apache.org>
Authored: Wed Jan 14 11:34:58 2015 -0600
Committer: Joshua McKenzie <jmckenzie@apache.org>
Committed: Wed Jan 14 11:37:23 2015 -0600

----------------------------------------------------------------------
 .../cassandra/io/sstable/SSTableRewriterTest.java       | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2fc9f329/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java b/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
index afad979..3703d54 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
@@ -214,21 +214,27 @@ public class SSTableRewriterTest extends SchemaLoader
         for (int i = 0; i < 100; i++)
             cf.addColumn(Util.cellname(i), ByteBuffer.allocate(1000), 1);
         File dir = cfs.directories.getDirectoryForNewSSTables();
+
         SSTableWriter writer = getWriter(cfs, dir);
         for (int i = 0; i < 500; i++)
             writer.append(StorageService.getPartitioner().decorateKey(ByteBufferUtil.bytes(i)),
cf);
         SSTableReader s = writer.openEarly(1000);
         assertFileCounts(dir.list(), 2, 3);
+
         for (int i = 500; i < 1000; i++)
             writer.append(StorageService.getPartitioner().decorateKey(ByteBufferUtil.bytes(i)),
cf);
         SSTableReader s2 = writer.openEarly(1000);
+
         assertTrue(s != s2);
         assertFileCounts(dir.list(), 2, 3);
-        s.markObsolete();
+
+        s.setReplacedBy(s2);
+        s2.markObsolete();
         s.releaseReference();
-        Thread.sleep(1000);
-        assertFileCounts(dir.list(), 0, 3);
+        s2.releaseReference();
+
         writer.abort(false);
+
         Thread.sleep(1000);
         int datafiles = assertFileCounts(dir.list(), 0, 0);
         assertEquals(datafiles, 0);


Mime
View raw message