yaojiejia opened a new pull request, #18377:
URL: https://github.com/apache/hudi/pull/18377

   ### Describe the issue this Pull Request addresses
   
   Closes #14508
   
   ```TestHoodieClientOnCopyOnWriteStorage``` contained a lot of very long test 
methods with duplicated setup and validation logic, refactoring it to make the 
file easier to maintain
   
   ### Summary and Changelog
   
   Refactored ```TestHoodieClientOnCopyOnWriteStorage``` by extracting repeated 
logic into private helper methods. No test behavior was changed.
   
   **New helpers added:**
   
   - `upsertBatchRecords`: wraps the upsert + commit boilerplate shared across 
multiple tests
   - `performMergeValidationCheck` (static): de-duplicates the two 
near-identical merge validation blocks in `testMergeHandle`
   - `getFileGroupIds`: de-duplicates repeated `getAllFileGroups` stream in 
`testUpdateRejectForClustering`
   - `verifyExpandedFile`: extracts Avro scan + record count assertion loop
   - `verifyTwoFileCommitDistribution`: asserts the two-file, two-commit layout 
expectation
   - `verifyInsertExpandedFile`: extracts commit-2 Avro scan loop in 
`testSmallInsertHandlingForInserts`
   - `verifyAllFilesAtCommit`: asserts all files belong to a given commit
   - `insertCommitWithSchema`: de-duplicates the two identical insert-commit 
blocks in `testWriteSchemaUsageOnPreCommitValidators`
   - `getLatestBaseFilesForPartition`: reduces repeated `String.format` + file 
listing pattern in `verifyDeletePartitionsHandling`
   - `createOccProperties` / `buildOccWriteConfig`: de-duplicate OCC config 
setup shared across three clustering/ingestion concurrency tests
   - `seedTableWithFirstCommit`: de-duplicates shared table seeding in OCC test 
trio
   - `startInflightInsertOverwrite`: de-duplicates the two identical 
uncommitted insert-overwrite blocks in `testParallelInsertOverwriteOperations`
   
   
   ### Impact
   
   No public API or user-facing changes. This is a pure internal test 
refactoring.
   
   
   ### Risk Level
   
   None. 
   
   ### Documentation Update
   
   <!-- Describe any necessary documentation update if there is any new 
feature, config, or user-facing change. If not, put "none".
   None.
   
   - The config description must be updated if new configs are added or the 
default value of the configs are changed.
   - Any new feature or user-facing change requires updating the Hudi website. 
Please follow the 
     [instruction](https://hudi.apache.org/contribute/developer-setup#website) 
to make changes to the website. -->
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable
   


-- 
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]

Reply via email to