You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by Martin Serrano <ma...@attivio.com> on 2015/08/31 02:55:37 UTC

TestingZooKeeperMain blockUntilStarted sleeps 1s

Hi,

I'm wondering what the purpose of the Thread.sleep(1000) is in the
TestingZooKeeperMain.blockUntilStarted() method.  We have some features
highly dependent on ZK-based services and these tests will start a
testing ZK for each test.  However most of the tests are otherwise very
fast.  The 1 second sleep adds up and makes the tests run unnecessarily
slow. 

Can this sleep be removed or reduced?  Depending on a sleep for anything
seems highly suspect in this case.

Thanks,
Martin

Re: TestingZooKeeperMain blockUntilStarted sleeps 1s

Posted by Jordan Zimmerman <jo...@jordanzimmerman.com>.
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?

-JZ
On August 30, 2015 at 6:33:43 PM, Martin Serrano (martin@attivio.com) wrote:

Hi,

I'm wondering what the purpose of the Thread.sleep(1000) is in the
TestingZooKeeperMain.blockUntilStarted() method. We have some features
highly dependent on ZK-based services and these tests will start a
testing ZK for each test. However most of the tests are otherwise very
fast. The 1 second sleep adds up and makes the tests run unnecessarily
slow.  

Can this sleep be removed or reduced? Depending on a sleep for anything
seems highly suspect in this case.

Thanks,
Martin