This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
     new 8cef32a  Flaky CompactionsBytemanTest
8cef32a is described below

commit 8cef32ae8376d23828a20b861161bd0d3845456f
Author: Bereng <berenguerbl...@gmail.com>
AuthorDate: Fri Dec 3 14:25:10 2021 +0100

    Flaky CompactionsBytemanTest
    
    patch by Berenguer Blasi; reviewed by Andres de la Peña for CASSANDRA-17171
---
 .../org/apache/cassandra/db/compaction/CompactionsBytemanTest.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/test/unit/org/apache/cassandra/db/compaction/CompactionsBytemanTest.java 
b/test/unit/org/apache/cassandra/db/compaction/CompactionsBytemanTest.java
index 95069f1..1c02699 100644
--- a/test/unit/org/apache/cassandra/db/compaction/CompactionsBytemanTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/CompactionsBytemanTest.java
@@ -27,6 +27,7 @@ import java.util.stream.Collectors;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import org.apache.cassandra.Util;
 import org.apache.cassandra.cql3.CQLTester;
 import org.apache.cassandra.db.ColumnFamilyStore;
 import org.apache.cassandra.db.Keyspace;
@@ -119,7 +120,7 @@ public class CompactionsBytemanTest extends CQLTester
             targetMethod = "submitBackground",
             targetLocation = "AT INVOKE 
java.util.concurrent.Future.isCancelled",
             condition = "!$cfs.keyspace.getName().contains(\"system\")",
-            action = "Thread.sleep(1000)")
+            action = "Thread.sleep(5000)")
     public void testCompactingCFCounting() throws Throwable
     {
         createTable("CREATE TABLE %s (k INT, c INT, v INT, PRIMARY KEY (k, 
c))");
@@ -127,9 +128,10 @@ public class CompactionsBytemanTest extends CQLTester
         cfs.enableAutoCompaction();
 
         execute("INSERT INTO %s (k, c, v) VALUES (?, ?, ?)", 0, 1, 1);
-        assertEquals(0, CompactionManager.instance.compactingCF.count(cfs));
+        Util.spinAssertEquals(true, () -> 
CompactionManager.instance.compactingCF.count(cfs) == 0, 5);
         cfs.forceBlockingFlush();
 
+        Util.spinAssertEquals(true, () -> 
CompactionManager.instance.compactingCF.count(cfs) == 0, 5);
         
FBUtilities.waitOnFutures(CompactionManager.instance.submitBackground(cfs));
         assertEquals(0, CompactionManager.instance.compactingCF.count(cfs));
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to