luoyuan3471 opened a new pull request, #8874: URL: https://github.com/apache/hadoop/pull/8874
# YARN-12044. Close the ZooKeeper cluster in TestLeaderElectorService teardown Jira: https://issues.apache.org/jira/browse/YARN-12044 ## Description of PR `TestLeaderElectorService.setUp()` starts a three-server `TestingCluster` for each test, but `tearDown()` stops only the ResourceManagers. The test-owned ZooKeeper cluster is left open. Close the cluster in a `finally` block after stopping the ResourceManagers so ZooKeeper cleanup is attempted even when ResourceManager shutdown fails. This changes test cleanup only. The existing HA assertions, timeouts, and production code are unchanged. ## How Was This Patch Tested? - Apache base: `f842297570243587f0ed7a81ebe80bb178098bca`. - JDK 17, Maven Wrapper, reactor compilation: passed. - `TestLeaderElectorService`: 6 tests, 0 failures, 0 errors, 0 skipped. - The fresh Surefire XML was checked in addition to the Maven result. - Diff whitespace check: passed. Command: ```sh ./mvnw -B -pl hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager -am -Dtest=TestLeaderElectorService -Dsurefire.failIfNoSpecifiedTests=false -Dmaven.test.failure.ignore=false -DforkCount=1 -DskipShade test ``` -- 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]
