parakhnr opened a new pull request, #2452: URL: https://github.com/apache/helix/pull/2452
### Issues - [X] My PR addresses the following Helix issues and references them in the PR description: Starting a ZK server is very time consuming and it's affecting the time taken to debug the integration tests since each test run starts ZK. This PR aims to optimise the start time. ### Description - [X] Here are some details about my PR, including screenshots of any UI changes: Currently `ZkServer.start()` queries all of the network interfaces to find if `localhost` is present in the interfaces whereas it will always be present since we manually add [localhost](https://github.com/apache/helix/blob/386a77d566f1dc0b480c3bcbdb4a2880a8b8a4a9/zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/NetworkUtil.java#L43) to the list of resolved network ips and hostnames. The call to `NetworkInterface.getNetworkInterfaces` is expensive and it is the reason for the increased time to start the Zk server. We also invoke the same method twice one just for logging and other for verifying 😞 Since ZKServer never accepts a Zk hostname to connect, the check to verify if the port is busy should be sufficient. ### Tests - [X] The following tests are written for this issue: Since this is a helper class, no unit tests exist for this class. However, integration tests and helix examples cover this path. I verified that Helix examples were running all good. - [X] The following is the result of the "mvn test" command on the appropriate module: Since the test classes are spread across I ran the `PR_CI` workflow on this commit and below are the results of it's execution. ``` [info] ./helix-core/target/surefire-reports/TestSuite.txt: Tests run: 1325, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5,743.07 s - in TestSuite [info] ./metadata-store-directory-common/target/surefire-reports/TestSuite.txt: Tests run: 31, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.886 s - in TestSuite [info] ./helix-common/target/surefire-reports/TestSuite.txt: Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.405 s - in TestSuite [info] ./metrics-common/target/surefire-reports/TestSuite.txt: Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.384 s - in TestSuite [info] ./helix-lock/target/surefire-reports/TestSuite.txt: Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 59.772 s - in TestSuite [info] ./helix-view-aggregator/target/surefire-reports/TestSuite.txt: Tests run: 15, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 60.445 s <<< FAILURE! - in TestSuite Error: Test failed: testHelixViewAggregator(org.apache.helix.view.integration.TestHelixViewAggregator) Time elapsed: 31.594 s <<< FAILURE! [info] ./helix-rest/target/surefire-reports/TestSuite.txt: Tests run: 209, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 166.17 s - in TestSuite [info] ./zookeeper-api/target/surefire-reports/TestSuite.txt: Tests run: 85, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 158.15 s - in TestSuite [info] ./recipes/task-execution/target/surefire-reports/TestSuite.txt: Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.585 s - in TestSuite [info] ./recipes/service-discovery/target/surefire-reports/TestSuite.txt: Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.637 s - in TestSuite [info] ./recipes/distributed-lock-manager/target/surefire-reports/TestSuite.txt: Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.615 s - in TestSuite [info] ./recipes/rsync-replicated-file-system/target/surefire-reports/TestSuite.txt: Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.62 s - in TestSuite [info] ./recipes/rabbitmq-consumer-group/target/surefire-reports/TestSuite.txt: Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.624 s - in TestSuite ``` ### Commits - [X] My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)": 1. Subject is separated from body by a blank line 1. Subject is limited to 50 characters (not including Jira issue reference) 1. Subject does not end with a period 1. Subject uses the imperative mood ("add", not "adding") 1. Body wraps at 72 characters 1. Body explains "what" and "why", not "how" ### Documentation (Optional) - [X] In case of new functionality, my PR adds documentation in the following wiki page: N/A ### Code Quality - [X] My diff has been formatted using helix-style.xml (helix-style-intellij.xml if IntelliJ IDE is used) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
