Fix race in RecoveryManagerTest patch by Sam Tunnicliffe; reviewed by jbellis for CASSANDRA-8176
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/fee71377 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/fee71377 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/fee71377 Branch: refs/heads/trunk Commit: fee713775cda0704e1cc188610ffe9005b6e2201 Parents: 1d285ea Author: Jonathan Ellis <jbel...@apache.org> Authored: Wed Oct 29 10:23:35 2014 -0500 Committer: Jonathan Ellis <jbel...@apache.org> Committed: Wed Oct 29 10:23:35 2014 -0500 ---------------------------------------------------------------------- CHANGES.txt | 1 + test/unit/org/apache/cassandra/db/RecoveryManagerTest.java | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/fee71377/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 7afed1e..274d07a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.1.2 + * Fix race in RecoveryManagerTest (CASSANDRA-8176) * Avoid IllegalArgumentException while sorting sstables in IndexSummaryManager (CASSANDRA-8182) * Shutdown JVM on file descriptor exhaustion (CASSANDRA-7579) http://git-wip-us.apache.org/repos/asf/cassandra/blob/fee71377/test/unit/org/apache/cassandra/db/RecoveryManagerTest.java ---------------------------------------------------------------------- diff --git a/test/unit/org/apache/cassandra/db/RecoveryManagerTest.java b/test/unit/org/apache/cassandra/db/RecoveryManagerTest.java index 2d820f3..460c267 100644 --- a/test/unit/org/apache/cassandra/db/RecoveryManagerTest.java +++ b/test/unit/org/apache/cassandra/db/RecoveryManagerTest.java @@ -40,13 +40,16 @@ import static org.apache.cassandra.Util.cellname; public class RecoveryManagerTest extends SchemaLoader { @Test - public void testNothingToRecover() throws IOException { + public void testNothingToRecover() throws IOException + { + CommitLog.instance.resetUnsafe(); CommitLog.instance.recover(); } @Test public void testOne() throws IOException { + CommitLog.instance.resetUnsafe(); Keyspace keyspace1 = Keyspace.open("Keyspace1"); Keyspace keyspace2 = Keyspace.open("Keyspace2"); @@ -77,6 +80,7 @@ public class RecoveryManagerTest extends SchemaLoader @Test public void testRecoverCounter() throws IOException { + CommitLog.instance.resetUnsafe(); Keyspace keyspace1 = Keyspace.open("Keyspace1"); Mutation rm; @@ -108,6 +112,7 @@ public class RecoveryManagerTest extends SchemaLoader @Test public void testRecoverPIT() throws Exception { + CommitLog.instance.resetUnsafe(); Date date = CommitLogArchiver.format.parse("2112:12:12 12:12:12"); long timeMS = date.getTime() - 5000; @@ -133,6 +138,7 @@ public class RecoveryManagerTest extends SchemaLoader @Test public void testRecoverPITUnordered() throws Exception { + CommitLog.instance.resetUnsafe(); Date date = CommitLogArchiver.format.parse("2112:12:12 12:12:12"); long timeMS = date.getTime();