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

   ### Describe the issue this Pull Request addresses
   
   `hudi-client-common` client utilities and services had thin unit coverage. 
This PR adds focused JUnit 5 tests for two client classes that are 
straightforward to exercise deterministically without a cluster: the DFS-based 
lock provider and the table service manager client.
   
   ### Summary and Changelog
   
   Adds two new test suites:
   
   - `TestFileSystemBasedLockProvider` 
(`org.apache.hudi.client.transaction.lock`): exercises 
`FileSystemBasedLockProvider` against a local temp directory. Covers 
acquire/release, contention between two providers over the same lock file, 
expiry-based reclamation (the lock file's modification time is aged 
deterministically via `HoodieStorage.setModificationTime`, no sleeps), the 
zero-expiry case that never reclaims, idempotent unlock, negative-expiry 
validation, and the `getLockConfig` helper producing usable properties.
   - `TestHoodieTableServiceManagerClient` (`org.apache.hudi.client`): mocks 
the HTTP transport with an in-process `com.sun.net.httpserver.HttpServer`. 
Asserts the request path per action (compact / clean / cluster) and the query 
parameters sent (action, db_name, table_name, basepath, instant, 
execution_engine, parallelism), plus retry/error handling: a 500 response is 
retried and surfaces `HoodieRemoteException`, and an unreachable endpoint also 
surfaces `HoodieRemoteException`.
   
   ### Impact
   
   Test-only change. No production code is modified, so there is no user-facing 
or API impact.
   
   ### Risk Level
   
   low
   
   Tests use local filesystem temp directories and an in-process HTTP server on 
an ephemeral port. No cluster, no external services, and no 
`Thread.sleep`-based timing; lock expiry is simulated by setting the lock file 
modification time.
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Enough context is provided in the sections above
   - [ ] 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