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 flaky CompactionsCQLTest
Date Fri, 28 Aug 2015 19:52:55 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 e5c142854 -> 56ec3c86d


Fix flaky CompactionsCQLTest

Patch by pmotta; reviewed by jmckenzie for CASSANDRA-10223


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

Branch: refs/heads/cassandra-3.0
Commit: 56ec3c86d7d1664dadca0038499b5e2c1828a7f6
Parents: e5c1428
Author: Paulo Motta <pauloricardomg@gmail.com>
Authored: Fri Aug 28 15:52:24 2015 -0400
Committer: Joshua McKenzie <jmckenzie@apache.org>
Committed: Fri Aug 28 15:52:24 2015 -0400

----------------------------------------------------------------------
 .../db/compaction/CompactionsCQLTest.java       | 21 ++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/56ec3c86/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java b/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java
index 7aa47c0..3c0098b 100644
--- a/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java
@@ -26,12 +26,17 @@ import org.apache.cassandra.cql3.CQLTester;
 import org.apache.cassandra.cql3.UntypedResultSet;
 import org.apache.cassandra.db.ColumnFamilyStore;
 import org.apache.cassandra.db.Keyspace;
+import org.apache.cassandra.utils.FBUtilities;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 public class CompactionsCQLTest extends CQLTester
 {
+
+    public static final int SLEEP_TIME = FBUtilities.isWindows()? 2000 : 1000;
+
     @Test
     public void testTriggerMinorCompactionSTCS() throws Throwable
     {
@@ -41,7 +46,7 @@ public class CompactionsCQLTest extends CQLTester
         flush();
         execute("insert into %s (id) values ('1')");
         flush();
-        Thread.sleep(1000);
+        Thread.sleep(SLEEP_TIME);
         assertTrue(minorWasTriggered(KEYSPACE, currentTable()));
     }
 
@@ -54,7 +59,7 @@ public class CompactionsCQLTest extends CQLTester
         flush();
         execute("insert into %s (id) values ('1')");
         flush();
-        Thread.sleep(1000);
+        Thread.sleep(SLEEP_TIME);
         assertTrue(minorWasTriggered(KEYSPACE, currentTable()));
     }
 
@@ -68,7 +73,7 @@ public class CompactionsCQLTest extends CQLTester
         flush();
         execute("insert into %s (id) values ('1')");
         flush();
-        Thread.sleep(1000);
+        Thread.sleep(SLEEP_TIME);
         assertTrue(minorWasTriggered(KEYSPACE, currentTable()));
     }
 
@@ -81,7 +86,7 @@ public class CompactionsCQLTest extends CQLTester
         flush();
         execute("insert into %s (id) values ('1')");
         flush();
-        Thread.sleep(1000);
+        Thread.sleep(SLEEP_TIME);
         assertFalse(minorWasTriggered(KEYSPACE, currentTable()));
     }
 
@@ -96,7 +101,7 @@ public class CompactionsCQLTest extends CQLTester
         flush();
         execute("insert into %s (id) values ('1')");
         flush();
-        Thread.sleep(1000);
+        Thread.sleep(SLEEP_TIME);
         assertTrue(minorWasTriggered(KEYSPACE, currentTable()));
     }
 
@@ -111,7 +116,7 @@ public class CompactionsCQLTest extends CQLTester
         flush();
         execute("insert into %s (id) values ('1')");
         flush();
-        Thread.sleep(1000);
+        Thread.sleep(SLEEP_TIME);
         assertFalse(minorWasTriggered(KEYSPACE, currentTable()));
     }
 
@@ -126,7 +131,7 @@ public class CompactionsCQLTest extends CQLTester
         flush();
         execute("insert into %s (id) values ('1')");
         flush();
-        Thread.sleep(1000);
+        Thread.sleep(SLEEP_TIME);
         assertFalse(minorWasTriggered(KEYSPACE, currentTable()));
     }
 
@@ -141,7 +146,7 @@ public class CompactionsCQLTest extends CQLTester
         flush();
         execute("insert into %s (id) values ('1')");
         flush();
-        Thread.sleep(1000);
+        Thread.sleep(SLEEP_TIME);
         assertTrue(minorWasTriggered(KEYSPACE, currentTable()));
     }
 


Mime
View raw message