joseluisll opened a new pull request, #8678:
URL: https://github.com/apache/hadoop/pull/8678
### Description of PR
The hadoop-tools slice of the mini-cluster leak scan recorded in HDFS-17957.
Two test classes hold mini-cluster references with no teardown in the class
or
any ancestor, so the clusters run until the surefire fork exits.
`TestCopyMapper` builds a `MiniDFSCluster` in `@BeforeAll` and never shuts it
down; 18 test methods share it. The new `@AfterAll` also covers
`TestCopyMapperCompositeCrc`, which hides `setup()` to build its own cluster
through `setCluster()` and inherits the teardown.
`TestMultipleArchiveFiles` builds a `MiniDFSCluster` and a `MiniMRCluster` in
its constructor. `TestStreaming` declares no `@TestInstance`, so the default
per-method lifecycle constructs a fresh pair for every test method — teardown
is therefore `@AfterEach`, not `@AfterAll`. It delegates to
`TestStreaming#tearDown()` and shuts both clusters down in a `finally`, so
they
come down even if the superclass teardown throws.
Impact: a leaked cluster keeps threads, heap and ports alive under the
remaining tests of the class.
Test-scope only; no production code is touched.
Disclosure: no CI failure was reproduced for this change. The relevant
ci-hadoop artifacts have aged out and Yetus reports at class granularity, so
these leaks were found by reading the code. They are real defects
independently, but causation against specific red runs is not proven.
### How was this patch tested?
`mvn test-compile -pl
hadoop-tools/hadoop-distcp,hadoop-tools/hadoop-streaming`
— BUILD SUCCESS, both modules.
Neither test was executed locally: `MiniDFSCluster` requires winutils on this
Windows machine, and the streaming test drives a POSIX shell (`xargs cat`).
Relying on Yetus for the run.
### For code changes:
- [x] Does the title of this PR start with the corresponding JIRA issue id
(e.g. 'HADOOP-17799. Your PR title ...')?
- [ ] Object storage: Have the integration tests been executed and the
endpoint
declared according to the connector-specific documentation? *Note:
Automated CI
testing doesn't cover all cases so manual testing with cloud storage
is still
required.*
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`,
`NOTICE-binary` files?
### AI Tooling
If an AI tool was used:
- [x] The PR includes the phrase "Contains content generated by <tool>"
where <tool> is the name of the AI tool used.
- [x] My use of AI contributions follows the ASF legal policy
https://www.apache.org/legal/generative-tooling.html
Contains content generated by Claude Code.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]