Pre-check
Search before asking
Apache Dubbo Component
Java SDK (apache/dubbo)
Descriptions
Current Problem
In the current implementation of StartZookeeperWindowsProcessor.java, there is a hardcoded "ugly sleep":
TimeUnit.SECONDS.sleep(3);
As noted in the TODO comment, this is inefficient and "ugly." It leads to:
- Flaky tests on slower CI environments (where 3s isn't enough).
- Unnecessary delay on fast environments (where Zookeeper starts in <500ms).
Proposed Change
I suggest replacing this fixed sleep with a proactive health check. Since the project already utilizes Apache Curator, we can leverage the blockUntilConnected() method to wait for the Zookeeper port to be ready, similar to how ResetZookeeperProcessor handles connections.
Also the catch Block should not swallow the errors.
This would align the Windows implementation with the Unix version's more reactive approach and improve overall test suite performance.
Affected File
dubbo-test/dubbo-test-check/src/main/java/org/apache/dubbo/test/check/registrycenter/processor/StartZookeeperWindowsProcessor.java
Related issues
No response
Are you willing to submit a pull request to fix on your own?
Code of Conduct
Pre-check
Search before asking
Apache Dubbo Component
Java SDK (apache/dubbo)
Descriptions
Current Problem
In the current implementation of StartZookeeperWindowsProcessor.java, there is a hardcoded "ugly sleep":
TimeUnit.SECONDS.sleep(3);
As noted in the TODO comment, this is inefficient and "ugly." It leads to:
Proposed Change
I suggest replacing this fixed sleep with a proactive health check. Since the project already utilizes Apache Curator, we can leverage the blockUntilConnected() method to wait for the Zookeeper port to be ready, similar to how ResetZookeeperProcessor handles connections.
Also the catch Block should not swallow the errors.
This would align the Windows implementation with the Unix version's more reactive approach and improve overall test suite performance.
Affected File
dubbo-test/dubbo-test-check/src/main/java/org/apache/dubbo/test/check/registrycenter/processor/StartZookeeperWindowsProcessor.java
Related issues
No response
Are you willing to submit a pull request to fix on your own?
Code of Conduct