You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ad...@apache.org on 2020/04/16 10:45:13 UTC

[cassandra] branch trunk updated: Fix flaky ConnectionTest#testMessagePurging patch by Yifan Cai; reviewed by Andres de la Pena for CASSANDRA-15338

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

adelapena pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 753b40e  Fix flaky ConnectionTest#testMessagePurging patch by Yifan Cai; reviewed by Andres de la Pena for CASSANDRA-15338
753b40e is described below

commit 753b40eb0f570fc88b5211b9bcea04761a240071
Author: yifan-c <yc...@gmail.com>
AuthorDate: Mon Mar 9 19:45:55 2020 -0700

    Fix flaky ConnectionTest#testMessagePurging
    patch by Yifan Cai; reviewed by Andres de la Pena for CASSANDRA-15338
---
 test/unit/org/apache/cassandra/net/ConnectionTest.java | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/test/unit/org/apache/cassandra/net/ConnectionTest.java b/test/unit/org/apache/cassandra/net/ConnectionTest.java
index d4ec84c..c507a80 100644
--- a/test/unit/org/apache/cassandra/net/ConnectionTest.java
+++ b/test/unit/org/apache/cassandra/net/ConnectionTest.java
@@ -615,17 +615,16 @@ public class ConnectionTest
             try
             {
                 inbound.open().sync();
-                CountDownLatch receiveDone = new CountDownLatch(1);
                 CountDownLatch deliveryDone = new CountDownLatch(1);
 
-                unsafeSetHandler(Verb._TEST_1, () -> msg -> receiveDone.countDown());
+                unsafeSetHandler(Verb._TEST_1, () -> msg -> {
+                    outbound.unsafeRunOnDelivery(deliveryDone::countDown);
+                });
                 outbound.enqueue(Message.out(Verb._TEST_1, noPayload));
                 Assert.assertEquals(1, outbound.pendingCount());
-                outbound.unsafeRunOnDelivery(deliveryDone::countDown);
 
-                Assert.assertTrue(receiveDone.await(10, SECONDS));
                 Assert.assertTrue(deliveryDone.await(10, SECONDS));
-                Assert.assertEquals(0, receiveDone.getCount());
+                Assert.assertEquals(0, deliveryDone.getCount());
                 Assert.assertEquals(0, outbound.pendingCount());
             }
             finally


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