[ 
https://issues.apache.org/jira/browse/MAPREDUCE-7546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18119596#comment-18119596
 ] 

ASF GitHub Bot commented on MAPREDUCE-7546:
-------------------------------------------

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)
   




> hadoop-mapreduce-client-jobclient tests jar cannot run sleep and most of its 
> other programs
> -------------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-7546
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-7546
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: client, test
>    Affects Versions: 3.5.0
>         Environment: Since 3.5.0, hadoop jar 
> hadoop-mapreduce-client-jobclient-*-tests.jar lists only 5 of its 29 
> programs, after a NoSuchMethodException for TestTextInputFormat.main. Running 
> any of the other programs, for example sleep -m 1 -r 1, fails with "Unknown 
> program" and exit code 255. The other missing programs include nnbench, 
> TestDFSIO, SliveTest, fail, largesorter and minicluster.
> Expected: the jar lists all its programs without errors, and sleep and the 
> others run again. This was broken by MAPREDUCE-7421.
> This surfaces in a testing harness that I made for testing HADOOP-19972 
> locally.
>            Reporter: Jose Luis López
>            Assignee: Jose Luis López
>            Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to