SuperMetaStream opened a new pull request, #2423:
URL: https://github.com/apache/uniffle/pull/2423

   # [MINOR] test: clean temp dir and allocate real ports for MiniDFSCluster
   
   ### What changes were proposed in this pull request?
   
   This PR improves the `KerberizedHadoop` test base class by addressing two 
main issues:
   
   1. **Temporary Directory Cleanup**:  
      Previously created temporary directories (e.g., `tempDir`, 
`kerberizedDfsBaseDir`) were not deleted after the test execution, which could 
lead to filesystem clutter. This PR ensures that they are properly cleaned up 
in the `tearDown()` method.
   
   2. **Port Allocation Simplification and Safety**:  
      Replaced the manual port selection logic (`findAvailablePorts`) with 
dynamic port allocation by configuring HDFS to use port `0`. This avoids the 
race condition where manually selected ports may be taken by other processes 
before being bound.
   
   ### Why are the changes needed?
   
   - To avoid polluting the `/tmp` filesystem with leftover directories.
   - To make the test setup more robust and avoid flaky failures caused by port 
conflicts.
   - To reduce unnecessary complexity and improve maintainability.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   - Existing tests using `KerberizedHadoop` were run multiple times to ensure 
stability.
   - Verified that no temporary directories remain after tests.
   - Verified that port binding is successful and dynamic allocation works as 
expected.
   
   


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