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)


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