You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2014/06/18 21:54:52 UTC

git commit: Fix BatchlogManagerTest consistency

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 c1b5c270d -> 760441ba0


Fix BatchlogManagerTest consistency

patch by Carl Yeksigian; reviewed by Michael Shuler for CASSANDRA-7397


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

Branch: refs/heads/cassandra-2.0
Commit: 760441ba0f0f536934a611ff1f55f30e658d2a1d
Parents: c1b5c27
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Jun 18 12:53:19 2014 -0700
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Jun 18 12:53:19 2014 -0700

----------------------------------------------------------------------
 test/unit/org/apache/cassandra/db/BatchlogManagerTest.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/760441ba/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java b/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
index 954c1f2..0b6a908 100644
--- a/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
+++ b/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
@@ -65,10 +65,10 @@ public class BatchlogManagerTest extends SchemaLoader
             RowMutation mutation = new RowMutation("Keyspace1", bytes(i));
             mutation.add("Standard1", bytes(i), bytes(i), System.currentTimeMillis());
 
-            long timestamp = System.currentTimeMillis();
-            if (i < 500)
-                timestamp -= DatabaseDescriptor.getWriteRpcTimeout() * 2;
-            BatchlogManager.getBatchlogMutationFor(Collections.singleton(mutation), UUIDGen.getTimeUUID(), timestamp * 1000).apply();
+            long timestamp = i < 500
+                           ? (System.currentTimeMillis() - DatabaseDescriptor.getWriteRpcTimeout() * 2) * 1000
+                           : Long.MAX_VALUE;
+            BatchlogManager.getBatchlogMutationFor(Collections.singleton(mutation), UUIDGen.getTimeUUID(), timestamp).apply();
         }
 
         // Flush the batchlog to disk (see CASSANDRA-6822).