joseluisll opened a new pull request, #8645:
URL: https://github.com/apache/hadoop/pull/8645

   ### Description of PR
   
   `TestFsVolumeList#testAddRplicaProcessorForAddingReplicaInMap` fails in some 
environments with "Fork pool should be initialize with configured pool size ==> 
expected: <5> but was: <4>".
   
   The test assumes the fork-join pool always holds as many threads as the 
configured pool size. That assumption is false: `ForkJoinPool` creates worker 
threads on demand, so `getPoolSize()` depends on the load of the environment 
and can be lower than the configured parallelism.
   
   What the test can verify deterministically is the pool's configuration. The 
fix changes the `@VisibleForTesting` accessor 
`BlockPoolSlice#getAddReplicaForkPoolSize()` to return `getParallelism()`, the 
configured value. No production behavior changes; the assertion in 
`TestFsVolumeList` is the accessor's only caller.
   
   ### How was this patch tested?
   
   `TestFsVolumeList#testAddRplicaProcessorForAddingReplicaInMap` and 
`#testInstanceOfAddReplicaThreadPool` pass locally (Windows 11, JDK 17, 24 
cores). A standalone probe replicating the production submit/fork pattern 
(`ForkJoinPool(5)`, two external submits, forked non-joining subtasks) showed 
`getPoolSize()` returning 4 in 15/15 runs under light task demand while 
`getParallelism()` returned 5 in all runs — reproducing the reported failure 
signature and confirming the fix asserts a deterministic quantity.
   
   ### For code changes:
   
   - [x] Does the title or this PR starts with the corresponding JIRA issue id 
(e.g. 'HADOOP-17799. Your PR title ...')?
   - [ ] Object storage: N/A
   - [ ] New dependencies: N/A — no dependencies added
   - [ ] LICENSE / LICENSE-binary / NOTICE-binary: N/A — no updates needed
   
   ### AI Tooling
   
   - [x] Contains content generated by Claude Code.
   - [x] My use of AI contributions follows the ASF legal policy 
https://www.apache.org/legal/generative-tooling.html
   
   🤖 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]

Reply via email to