You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2022/11/09 18:00:59 UTC

[cassandra] branch cassandra-4.1 updated (e12dc48c87 -> 8f47d232fa)

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

brandonwilliams pushed a change to branch cassandra-4.1
in repository https://gitbox.apache.org/repos/asf/cassandra.git


    from e12dc48c87 Merge branch 'cassandra-4.0' into cassandra-4.1
     new 70478a1578 Fix testCommitLogInitWithException: signal condition instead of killing thread
     new 8f47d232fa Merge branch 'cassandra-4.0' into cassandra-4.1

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../commitlog/CommitLogInitWithExceptionTest.java  | 32 +++++-----------------
 1 file changed, 7 insertions(+), 25 deletions(-)


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


[cassandra] 01/01: Merge branch 'cassandra-4.0' into cassandra-4.1

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8f47d232faeacb44087712dd5524db96d92aae46
Merge: e12dc48c87 70478a1578
Author: Brandon Williams <br...@apache.org>
AuthorDate: Wed Nov 9 11:59:49 2022 -0600

    Merge branch 'cassandra-4.0' into cassandra-4.1

 .../commitlog/CommitLogInitWithExceptionTest.java  | 32 +++++-----------------
 1 file changed, 7 insertions(+), 25 deletions(-)

diff --cc test/unit/org/apache/cassandra/db/commitlog/CommitLogInitWithExceptionTest.java
index fbad0b4857,21d207bea2..b3cff94c66
--- a/test/unit/org/apache/cassandra/db/commitlog/CommitLogInitWithExceptionTest.java
+++ b/test/unit/org/apache/cassandra/db/commitlog/CommitLogInitWithExceptionTest.java
@@@ -19,6 -19,6 +19,8 @@@
  package org.apache.cassandra.db.commitlog;
  
  
++import org.apache.cassandra.Util;
++import org.apache.cassandra.utils.concurrent.Condition;
  import org.junit.Assert;
  import org.junit.BeforeClass;
  import org.junit.Test;
@@@ -27,12 -27,14 +29,13 @@@ import org.apache.cassandra.CassandraIs
  import org.apache.cassandra.config.Config;
  import org.apache.cassandra.config.DatabaseDescriptor;
  import org.apache.cassandra.utils.JVMStabilityInspector;
 -import org.apache.cassandra.utils.concurrent.SimpleCondition;
 +
+ 
  @RunWith(CassandraIsolatedJunit4ClassRunner.class)
  public class CommitLogInitWithExceptionTest
  {
 -    private final static SimpleCondition killed = new SimpleCondition();
 -
 +    private static Thread initThread;
- 
++    private final static Condition killed = Condition.newOneTimeCondition();
      @BeforeClass
      public static void setUp()
      {
@@@ -56,41 -58,20 +59,20 @@@
              }
              finally
              {
-                 Assert.assertNotNull(initThread);
-                 // We have to manually stop init thread because the JVM does not exit actually.
-                 initThread.stop();
 -                killed.signalAll();
++                killed.signal();
              }
          };
      }
  
-     @Test(timeout = 30000)
+     @Test
      public void testCommitLogInitWithException() {
          // This line will trigger initialization process because it's the first time to access CommitLog class.
 -        Thread initThread = new Thread(CommitLog.instance::start);
 +        initThread = new Thread(CommitLog.instance::start);
  
          initThread.setName("initThread");
          initThread.start();
  
-         try
-         {
-             initThread.join(); // Should not block here
-         }
-         catch (InterruptedException expected)
-         {
-         }
- 
-         Assert.assertFalse(initThread.isAlive());
- 
-         try
-         {
-             Thread.sleep(1000); // Wait for COMMIT-LOG-ALLOCATOR exit
-         }
-         catch (InterruptedException e)
-         {
-             Assert.fail();
-         }
- 
-         Assert.assertTrue(CommitLog.instance.segmentManager.executor.isTerminated()); // exit successfully
 -        Util.spinAssertEquals(true, killed::isSignaled, 120);
++        Util.spinAssertEquals(true, killed::isSignalled, 10);
      }
  
      private static class MockCommitLogSegmentMgr extends CommitLogSegmentManagerStandard {


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