joseluisll opened a new pull request, #8759:
URL: https://github.com/apache/hadoop/pull/8759
### Description of PR
MAPREDUCE-7421 commented out `TestTextInputFormat.main()`, but
`MapredTestDriver` still registers
the class as `testtextinputformat`. `ProgramDriver.addClass()` looks up
`main(String[])`
reflectively and throws. The driver's constructor swallows that and stops
registering, so the
jobclient tests jar lists 5 of its 29 programs. `sleep`, `nnbench`,
`TestDFSIO`, `SliveTest`,
`minicluster` and the rest fail with "Unknown program" and exit 255.
- `TestTextInputFormat`: uncomment `main()`. That is the whole fix.
- New `TestMapredTestDriver`: constructs `MapredTestDriver` with a recording
`ProgramDriver` and
asserts that every `addClass` succeeded and that `sleep` is registered.
No other class registered in `MapredTestDriver` lost its `main()`. The same
holds for
`ExampleDriver`, `HdfsTestDriver` and `YarnTestDriver`.
### How was this patch tested?
WSL2 Ubuntu 24.04, OpenJDK 17.0.20, Maven 3.9.16.
Dist: `mvn install -Pdist -Dtar -DskipTests -DskipShade`.
| Check | trunk `90f0d1da37` | this patch |
|---|---|---|
| `TestMapredTestDriver` | 1 run, 1 failure: `testtextinputformat ...
NoSuchMethodException` | 1 run, 0 failures |
| `TestTextInputFormat` | not run | 9 runs, 0 failures |
| `hadoop jar ...jobclient-*-tests.jar` (no args), programs listed | 5,
preceded by the `NoSuchMethodException` stack trace | 29, no exception |
| `hadoop jar ... sleep -m 1 -r 1` | exit 255, "Unknown program" | n/a |
| `hadoop jar ... sleep -m 1 -r 1 -mt 1 -rt 1` on a single-node HDFS + YARN
cluster | n/a | exit 0, `Job job_..._0001 completed successfully`, 1 map + 1
reduce, app FINAL-STATE SUCCEEDED |
| `hadoop jar ... testtextinputformat "a\nb"` | n/a | prints `Got: a`, `Got:
b` |
| checkstyle (jobclient, test sources): findings on new/changed lines | n/a
| 0 |
### 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? *(N/A)*
- [ ] 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)? *(N/A, no new
dependencies)*
- [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`,
`NOTICE-binary` files? *(N/A)*
### 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]