[ 
https://issues.apache.org/jira/browse/HDFS-17784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18063936#comment-18063936
 ] 

ASF GitHub Bot commented on HDFS-17784:
---------------------------------------

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

   ## Summary
   
   Both `TestBlockTokenWrappingQOP` and `TestMultipleNNPortQOP` hardcoded 
specific TCP ports for the NameNode service-RPC and auxiliary-RPC endpoints:
   
   | Test | Old service port | Old auxiliary ports |
   |---|---|---|
   | `TestBlockTokenWrappingQOP` | `9020` | `12000` |
   | `TestMultipleNNPortQOP` | `9021` | `12001`, `12101`, `12201` |
   
   When these tests run in parallel (common in CI with forked JVMs), or when 
the OS delays releasing a recently used port, the cluster startup throws a 
`BindException` and the test fails transiently.
   
   ## Fix
   
   Replace every hardcoded port with a dynamically allocated free port:
   - `TestBlockTokenWrappingQOP.setup()`: allocate 2 ports via 
`NetUtils.getFreeSocketPort()`; store the auxiliary port as an instance field 
so the `URI` built later references the same value.
   - `TestMultipleNNPortQOP.setup()`: allocate 4 ports via 
`NetUtils.getFreeSocketPorts(4)`; store `authPort`, `integrityPort`, 
`privacyPort` as static fields; update all `ingress.port.sasl.*` config keys 
and the three `URI` references in each test method.
   
   ## Test plan
   - [ ] `mvn package -pl hadoop-hdfs-project/hadoop-hdfs -am -DskipTests` 
compiles cleanly ✅
   - [ ] No hardcoded port numbers remain in the two modified files ✅
   - [ ] Full test run expected to pass on CI (Kerberos environment required 
for these tests)




> Port conflict in TestBlockTokenWrappingQOP and TestMultipleNNPortQOP
> --------------------------------------------------------------------
>
>                 Key: HDFS-17784
>                 URL: https://issues.apache.org/jira/browse/HDFS-17784
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Istvan Toth
>            Priority: Minor
>              Labels: test
>
> Both tests set DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, to "localhost:9020" and 
> can conflict when running the tests in parallel



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to