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

   ## Summary
   
   Systematically migrate all `AvailablePortFinder.getNextAvailable()` usages 
across the codebase to the `@RegisterExtension AvailablePortFinder.Port` 
pattern. This ensures proper port lifecycle management — ports are reserved 
until after tests complete, preventing `BindException` flakiness in parallel 
test execution.
   
   - **210 files** migrated across 60+ components
   - Remaining intentional exceptions:
     - `AvailablePortFinderPropertiesFunction` — internal API implementation
     - `AvailablePortFinderTest` — tests for the class itself
     - `AbstractKeycloakTest` — commented out, not real usage
     - `test-infra-artemis` services — service implementations, not JUnit tests
     - `JettyFailoverRoundRobinTest` — already handled in #22094
   
   ## Patterns applied
   
   1. **Static field initializers** → `@RegisterExtension static 
AvailablePortFinder.Port`
   2. **Instance field initializers** → `@RegisterExtension 
AvailablePortFinder.Port`
   3. **`@BeforeAll` allocation** → removed in favor of `@RegisterExtension` 
auto-lifecycle
   4. **Method-local allocation** → `try (var p = AvailablePortFinder.find()) { 
port = p.getPort(); }`
   5. **Base test support classes** → `protected` port fields for subclass 
access
   
   ## Test plan
   
   - [ ] CI build passes (incremental build will test affected modules)
   - [ ] No `BindException` flakiness from port conflicts


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