curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Serrano (JIRA)" <>
Subject [jira] [Created] (CURATOR-257) Thread.sleep in TestingZooKeeperMain.blockUntilStarted is not required
Date Tue, 01 Sep 2015 03:03:45 GMT
Martin Serrano created CURATOR-257:

             Summary: Thread.sleep in TestingZooKeeperMain.blockUntilStarted is not required
                 Key: CURATOR-257
             Project: Apache Curator
          Issue Type: Improvement
          Components: Tests
            Reporter: Martin Serrano
            Priority: Minor

The {{TestingZooKeeperMain.blockUntilStarted()}} contains a {{Thread.sleep(1000)}} call. 
In a large battery of unit level tests (which are otherwise quick and depend on curator service
discovery) this time adds up.

Recent communication from JZ regarding the code:
As I recall, it takes some time for the server to start up and this was a hack to make sure
it’s ready.  However, I no longer remember the details. Do tests work with the timeout removed?

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 thread, so I think it will show any such issues within a few runs.  If no issues
appear (and the curator tests pass of course) I will post a pull request.  

A sleep of this sort is unreliable to ensure startup anyway.  While it may be very unlikely
for the server not to be up after 1 second, I've found with similar approaches that these
types of solutions will still fail once it a while, leading to odd and hard to reproduce test

This message was sent by Atlassian JIRA

View raw message