luoyuan3471 opened a new pull request, #8876: URL: https://github.com/apache/hadoop/pull/8876
# YARN-12045. Close MockRM fixtures in placement constraint tests Jira: https://issues.apache.org/jira/browse/YARN-12045 ## Description of PR `TestAllocationTagsManager` and `TestPlacementConstraintsUtil` start a `MockRM` in their setup methods but keep it only in a local variable. Neither class has a teardown method that stops its ResourceManager. Keep each ResourceManager on the test instance and stop it in `@AfterEach`. This also makes cleanup run when setup or an assertion fails. The two classes share the same fixture-lifecycle defect in the same package. All existing placement assertions remain unchanged; no production code or test timeouts are modified. ## How Was This Patch Tested? - Apache base: `f842297570243587f0ed7a81ebe80bb178098bca`. - JDK 17, Maven Wrapper, reactor compilation: passed. - `TestAllocationTagsManager`: 6 tests, 0 failures, 0 errors, 0 skipped. - `TestPlacementConstraintsUtil`: 12 tests, 0 failures, 0 errors, 0 skipped. - The fresh Surefire XML files were 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=TestAllocationTagsManager,TestPlacementConstraintsUtil -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]
