gnodet opened a new pull request, #22102:
URL: https://github.com/apache/camel/pull/22102

   ## Summary
   
   - Fix `new ServerSocket(0)` anti-pattern in test infrastructure and test code
   - Using `new ServerSocket(0)` to find a free port and closing it immediately 
creates a race condition where another process can grab the port between the 
close and actual use
   - Fixed by using `setReuseAddress(true)` before binding, matching the 
pattern used by `AvailablePortFinder`
   
   ### Changed files:
   - `StrimziContainer` / `ConfluentContainer` (kafka test-infra): inline fix 
with `setReuseAddress(true)`
   - `PubSubApiTest` (salesforce): use `AvailablePort.probePort()`
   - `ServerAnnotationProcessor` (camel-ldap, camel-ldif): use 
try-with-resources and `setReuseAddress(true)`
   
   ## Test plan
   
   - [x] All affected modules compile successfully
   - [x] No behavioral change — same port-finding logic, just with 
`setReuseAddress(true)` to prevent race conditions


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