This is an automated email from the ASF dual-hosted git repository.
bereng pushed a commit to branch cassandra-5.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/cassandra-5.0 by this push:
new 5e4ff921af Add extra compaction junit
5e4ff921af is described below
commit 5e4ff921afb9d8cb2deacbfd24db78ea4e2ccbe1
Author: Bereng <[email protected]>
AuthorDate: Tue Oct 22 14:27:49 2024 +0200
Add extra compaction junit
patch by Berenguer Blasi; reviewed by Branimir Lambov, Michael Semb Wever
for CASSANDRA-19863
---
.../CompactionStrategyManagerPendingRepairTest.java | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git
a/test/unit/org/apache/cassandra/db/compaction/CompactionStrategyManagerPendingRepairTest.java
b/test/unit/org/apache/cassandra/db/compaction/CompactionStrategyManagerPendingRepairTest.java
index 028d28303e..d809644e1c 100644
---
a/test/unit/org/apache/cassandra/db/compaction/CompactionStrategyManagerPendingRepairTest.java
+++
b/test/unit/org/apache/cassandra/db/compaction/CompactionStrategyManagerPendingRepairTest.java
@@ -24,6 +24,7 @@ import java.util.List;
import com.google.common.collect.Iterables;
+import org.apache.cassandra.Util;
import org.apache.cassandra.repair.consistent.LocalSession;
import org.junit.Assert;
@@ -374,15 +375,29 @@ public class CompactionStrategyManagerPendingRepairTest
extends AbstractPendingR
System.out.println("Live sstables: " + cfs.getLiveSSTables().size());
System.out.println("*********************************************************************************************");
+
// Run compaction again. It should pick up the pending repair sstable
compactionTask = csm.getNextBackgroundTask(FBUtilities.nowInSeconds());
if (compactionTask != null)
{
Assert.assertSame(PendingRepairManager.RepairFinishedCompactionTask.class,
compactionTask.getClass());
compactionTask.execute(ActiveCompactionsTracker.NOOP);
- Assert.assertEquals(1, cfs.getLiveSSTables().size());
+
+ while ((compactionTask =
csm.getNextBackgroundTask(FBUtilities.nowInSeconds())) != null)
+ compactionTask.execute(ActiveCompactionsTracker.NOOP);
}
+ // Make sure you consume all pending compactions
+ Util.spinAssertEquals(Boolean.FALSE,
+ () -> {
+ AbstractCompactionTask ctask;
+ while ((ctask =
csm.getNextBackgroundTask(FBUtilities.nowInSeconds())) != null)
+
ctask.execute(ActiveCompactionsTracker.NOOP);
+
+ return hasPendingStrategiesFor(repairID);
+ },
+ 30);
+
System.out.println("*********************************************************************************************");
System.out.println(compactedSSTable);
System.out.println("Pending repair UUID: " +
compactedSSTable.getPendingRepair());
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]