HDFS-17951. Fix TestFsVolumeList#testAddRplicaProcessorForAddingReplicaInMap. - #8645
Open
joseluisll wants to merge 1 commit into
Open
HDFS-17951. Fix TestFsVolumeList#testAddRplicaProcessorForAddingReplicaInMap.#8645joseluisll wants to merge 1 commit into
joseluisll wants to merge 1 commit into
Conversation
…caInMap by asserting the pool's configured parallelism. ForkJoinPool.getPoolSize() returns the number of worker threads that have spawned, which tracks task demand and varies by environment; getParallelism() deterministically returns the configured pool size the assertion intends to verify. Contains content generated by Claude Code. Generated-by: Claude Code (claude-fable-5) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
TestFsVolumeList#testAddRplicaProcessorForAddingReplicaInMapfails 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:
ForkJoinPoolcreates worker threads on demand, sogetPoolSize()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
@VisibleForTestingaccessorBlockPoolSlice#getAddReplicaForkPoolSize()to returngetParallelism(), the configured value. No production behavior changes; the assertion inTestFsVolumeListis the accessor's only caller.How was this patch tested?
TestFsVolumeList#testAddRplicaProcessorForAddingReplicaInMapand#testInstanceOfAddReplicaThreadPoolpass 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) showedgetPoolSize()returning 4 in 15/15 runs under light task demand whilegetParallelism()returned 5 in all runs — reproducing the reported failure signature and confirming the fix asserts a deterministic quantity.For code changes:
AI Tooling
🤖 Generated with Claude Code