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

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


The following commit(s) were added to refs/heads/cassandra-6.0 by this push:
     new 8fd77ffea3 Improve stability of CMSShutdownTest
8fd77ffea3 is described below

commit 8fd77ffea3e10359b61608867689fe693d8b401a
Author: C. Scott Andreas <[email protected]>
AuthorDate: Wed Jul 22 16:24:06 2026 +0100

    Improve stability of CMSShutdownTest
    
    Patch by C. Scott Andreas; reviewed by Sam Tunnicliffe for CASSANDRA-21501
---
 .../cassandra/distributed/test/tcm/CMSShutdownTest.java     | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git 
a/test/distributed/org/apache/cassandra/distributed/test/tcm/CMSShutdownTest.java
 
b/test/distributed/org/apache/cassandra/distributed/test/tcm/CMSShutdownTest.java
index 6d8debdd7f..74dece0661 100644
--- 
a/test/distributed/org/apache/cassandra/distributed/test/tcm/CMSShutdownTest.java
+++ 
b/test/distributed/org/apache/cassandra/distributed/test/tcm/CMSShutdownTest.java
@@ -50,7 +50,7 @@ public class CMSShutdownTest extends TestBaseImpl
         // This test simulates a CMS node attempting to commit an entry to the 
log but being unable
         // to obtain consensus from other CMS members while it is also 
shutting down itself.
         try (Cluster cluster = Cluster.build(2)
-                                      .withConfig(c -> 
c.with(Feature.values()))
+                                      .withConfig(c -> c.with(Feature.GOSSIP, 
Feature.NETWORK))
                                       
.withInstanceInitializer(BBHelper::install)
                                       .start())
         {
@@ -67,8 +67,15 @@ public class CMSShutdownTest extends TestBaseImpl
             // latch ensures that every commit will fail as if unable to 
obtain consensus
             // from other CMS members
             State.latch.countDown();
-            for (; ;)
-                
ClusterMetadataService.instance().commit(TriggerSnapshot.instance);
+            try
+            {
+                while (!Thread.currentThread().isInterrupted())
+                    
ClusterMetadataService.instance().commit(TriggerSnapshot.instance);
+            }
+            catch (Throwable t)
+            {
+                // Commits fail by design; an interrupt or a stopped processor 
on shutdown ends them.
+            }
         }
 
         public static void scheduleCommits()


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

Reply via email to