From commits-return-7957-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Sat Sep 14 14:30:57 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id B67BD180637 for ; Sat, 14 Sep 2019 16:30:56 +0200 (CEST) Received: (qmail 45376 invoked by uid 500); 14 Sep 2019 14:30:56 -0000 Mailing-List: contact commits-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list commits@zookeeper.apache.org Received: (qmail 45365 invoked by uid 99); 14 Sep 2019 14:30:56 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Sep 2019 14:30:56 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id BC4A580912; Sat, 14 Sep 2019 14:30:55 +0000 (UTC) Date: Sat, 14 Sep 2019 14:30:55 +0000 To: "commits@zookeeper.apache.org" Subject: [zookeeper] branch branch-3.5.6 updated: ZOOKEEPER-3542: X509UtilTest#testClientRenegotiationFails is flaky on JDK8 + linux on machines with 2 cores MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <156847145563.6141.2783833619084225095@gitbox.apache.org> From: eolivelli@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: zookeeper X-Git-Refname: refs/heads/branch-3.5.6 X-Git-Reftype: branch X-Git-Oldrev: 1b8e3b720579b54339f53da99ee702ec629ef446 X-Git-Newrev: f14f4b99ce5b6b791c81aed4b33957118491f56e X-Git-Rev: f14f4b99ce5b6b791c81aed4b33957118491f56e X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. eolivelli pushed a commit to branch branch-3.5.6 in repository https://gitbox.apache.org/repos/asf/zookeeper.git The following commit(s) were added to refs/heads/branch-3.5.6 by this push: new f14f4b9 ZOOKEEPER-3542: X509UtilTest#testClientRenegotiationFails is flaky on JDK8 + linux on machines with 2 cores f14f4b9 is described below commit f14f4b99ce5b6b791c81aed4b33957118491f56e Author: Enrico Olivelli AuthorDate: Sat Sep 14 16:30:30 2019 +0200 ZOOKEEPER-3542: X509UtilTest#testClientRenegotiationFails is flaky on JDK8 + linux on machines with 2 cores Author: Enrico Olivelli Reviewers: Norbert Kalmar Closes #1087 from eolivelli/fix/ZOOKEEPER-3542-35 (cherry picked from commit 54de5f55ac75206088efd23239240214780f8bca) Signed-off-by: Enrico Olivelli --- .../src/test/java/org/apache/zookeeper/common/X509UtilTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/common/X509UtilTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/common/X509UtilTest.java index 004b8df..6e35293 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/common/X509UtilTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/common/X509UtilTest.java @@ -25,10 +25,12 @@ import java.net.Socket; import java.security.Security; import java.util.Collection; import java.util.concurrent.Callable; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import javax.net.ssl.HandshakeCompletedEvent; @@ -527,6 +529,7 @@ public class X509UtilTest extends BaseX509ParameterizedTestCase { SSLSocket clientSocket = null; SSLSocket serverSocket = null; final AtomicInteger handshakesCompleted = new AtomicInteger(0); + final CountDownLatch handshakeCompleted = new CountDownLatch(1); try { InetSocketAddress localServerAddress = new InetSocketAddress( InetAddress.getLoopbackAddress(), port); @@ -540,6 +543,7 @@ public class X509UtilTest extends BaseX509ParameterizedTestCase { @Override public void handshakeCompleted(HandshakeCompletedEvent handshakeCompletedEvent) { handshakesCompleted.getAndIncrement(); + handshakeCompleted.countDown(); } }); Assert.assertEquals(1, sslSocket.getInputStream().read()); @@ -572,6 +576,7 @@ public class X509UtilTest extends BaseX509ParameterizedTestCase { workerPool.shutdown(); // Make sure the first handshake completed and only the second // one failed. + handshakeCompleted.await(5, TimeUnit.SECONDS); Assert.assertEquals(1, handshakesCompleted.get()); } }