Return-Path: X-Original-To: apmail-curator-dev-archive@minotaur.apache.org Delivered-To: apmail-curator-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E114A180B5 for ; Thu, 3 Sep 2015 20:43:45 +0000 (UTC) Received: (qmail 62929 invoked by uid 500); 3 Sep 2015 20:43:45 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 62874 invoked by uid 500); 3 Sep 2015 20:43:45 -0000 Mailing-List: contact dev-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list dev@curator.apache.org Received: (qmail 62858 invoked by uid 99); 3 Sep 2015 20:43:45 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Sep 2015 20:43:45 +0000 Date: Thu, 3 Sep 2015 20:43:45 +0000 (UTC) From: "Jordan Zimmerman (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CURATOR-257) Thread.sleep in TestingZooKeeperMain.blockUntilStarted is costly for unit tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CURATOR-257?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D147= 29746#comment-14729746 ]=20 Jordan Zimmerman commented on CURATOR-257: ------------------------------------------ This could be an error in the test. I'll have a look when I get a chance. > Thread.sleep in TestingZooKeeperMain.blockUntilStarted is costly for unit= tests > -------------------------------------------------------------------------= ------ > > Key: CURATOR-257 > URL: https://issues.apache.org/jira/browse/CURATOR-257 > Project: Apache Curator > Issue Type: Improvement > Components: Tests > Reporter: Martin Serrano > Priority: Minor > > The {{TestingZooKeeperMain.blockUntilStarted()}} contains a {{Thread.slee= p(1000)}} call. In a large battery of unit level tests (which are otherwis= e quick and depend on curator service discovery) this time adds up. > Recent communication from JZ regarding the code: > {quote} > As I recall, it takes some time for the server to start up and this was a= hack to make sure it=E2=80=99s ready. However, I no longer remember the d= etails. Do tests work with the timeout removed? > {quote} > We are in the midst of running our battery of tests to see if removal of = this sleep call causes any issues. Our set of tests starts and stops the = testing server a few hundred times within the same process, so I think it w= ill show any such issues within a few runs. If no issues appear (and the c= urator tests pass of course) I will post a pull request. =20 > A sleep of this sort is unreliable to ensure startup anyway. While it ma= y be very unlikely for the server not to be up after 1 second, I've found w= ith similar approaches that these types of solutions will still fail once i= t a while, leading to odd and hard to reproduce test failures. -- This message was sent by Atlassian JIRA (v6.3.4#6332)