Skip to content

Commit

Permalink
Flaky CompactionsBytemanTest
Browse files Browse the repository at this point in the history
patch by Berenguer Blasi; reviewed by Andres de la Peña for CASSANDRA-17171
  • Loading branch information
bereng committed Dec 9, 2021
1 parent 15eaa95 commit 8cef32a
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -27,6 +27,7 @@
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;
Expand Down Expand Up @@ -119,17 +120,18 @@ public void testRuntimeExceptionWhenNoDiskSpaceForCompaction() throws Throwable
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))");
ColumnFamilyStore cfs = getCurrentColumnFamilyStore();
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));
}
Expand Down

0 comments on commit 8cef32a

Please sign in to comment.