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 38857dc047 Add extra compaction junit
38857dc047 is described below

commit 38857dc0472edf84d76f353def78075e403e505f
Author: Bereng <[email protected]>
AuthorDate: Tue Oct 15 14:42:11 2024 +0200

    Add extra compaction junit
    
    patch by Berenguer Blasi; reviewed by Branimir Lambov for CASSANDRA-19863
---
 .../CompactionStrategyManagerPendingRepairTest.java          | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git 
a/test/unit/org/apache/cassandra/db/compaction/CompactionStrategyManagerPendingRepairTest.java
 
b/test/unit/org/apache/cassandra/db/compaction/CompactionStrategyManagerPendingRepairTest.java
index d87b384afd..028d28303e 100644
--- 
a/test/unit/org/apache/cassandra/db/compaction/CompactionStrategyManagerPendingRepairTest.java
+++ 
b/test/unit/org/apache/cassandra/db/compaction/CompactionStrategyManagerPendingRepairTest.java
@@ -348,7 +348,6 @@ public class CompactionStrategyManagerPendingRepairTest 
extends AbstractPendingR
         for (SSTableReader sstable : sstables)
             pendingContains(sstable);
         AbstractCompactionTask compactionTask = 
csm.getNextBackgroundTask(FBUtilities.nowInSeconds());
-        Assert.assertNotNull(compactionTask);
 
         // Finalize the repair session
         LocalSessionAccessor.finalizeUnsafe(repairID);
@@ -357,12 +356,15 @@ public class CompactionStrategyManagerPendingRepairTest 
extends AbstractPendingR
         Assert.assertTrue(hasPendingStrategiesFor(repairID));
 
         // run the compaction
-        compactionTask.execute(ActiveCompactionsTracker.NOOP);
+        if (compactionTask != null)
+        {
+            compactionTask.execute(ActiveCompactionsTracker.NOOP);
+            Assert.assertEquals(1, cfs.getLiveSSTables().size());
+        }
 
-        // The repair session is finalized but there is an sstable left behind 
pending repair!
+        // The repair session is finalized but there could be an sstable left 
behind pending repair!
         SSTableReader compactedSSTable = 
cfs.getLiveSSTables().iterator().next();
         Assert.assertEquals(repairID, compactedSSTable.getPendingRepair());
-        Assert.assertEquals(1, cfs.getLiveSSTables().size());
 
         
System.out.println("*********************************************************************************************");
         System.out.println(compactedSSTable);
@@ -378,6 +380,7 @@ public class CompactionStrategyManagerPendingRepairTest 
extends AbstractPendingR
         {
             
Assert.assertSame(PendingRepairManager.RepairFinishedCompactionTask.class, 
compactionTask.getClass());
             compactionTask.execute(ActiveCompactionsTracker.NOOP);
+            Assert.assertEquals(1, cfs.getLiveSSTables().size());
         }
 
         
System.out.println("*********************************************************************************************");
@@ -388,7 +391,6 @@ public class CompactionStrategyManagerPendingRepairTest 
extends AbstractPendingR
         System.out.println("Live sstables: " + cfs.getLiveSSTables().size());
         
System.out.println("*********************************************************************************************");
 
-        Assert.assertEquals(1, cfs.getLiveSSTables().size());
         Assert.assertFalse(hasPendingStrategiesFor(repairID));
         Assert.assertFalse(hasTransientStrategiesFor(repairID));
         Assert.assertTrue(repairedContains(compactedSSTable));


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to