slachiewicz opened a new pull request, #18778:
URL: https://github.com/apache/iceberg/pull/18778

   `RESTServerExtension` picks a free port by opening and closing a 
`ServerSocket(0)`, and Jetty binds that port later, so another test JVM can 
take it in between and the class fails with `BindException: Address already in 
use` (seen in [Spark 4.2 extensions, 
`TestAddFilesProcedure`](https://github.com/slachiewicz/iceberg/actions/runs/41654790992/job/125982106978)).
 The retry from #13017 never runs, because Jetty wraps the `BindException` in 
an `IOException`; #17109 found the same and was closed as stale. This removes 
the window instead of widening the catch: the server binds port 0 itself, and 
the client uses the port `RESTCatalogServer.port()` reports. The retry loop and 
`RCKUtils.findFreePort` go.
   
   Test plan: `TestRESTServerExtension` runs the extension on `FREE_PORT` and 
checks that `config()` holds the bound port and the client works; 
`TestRESTCatalogServer` starts two servers on port 0 and checks they get 
distinct ports and both serve `/v1/config`. The race itself cannot be forced 
deterministically. `:iceberg-open-api:test` passes on JDK 21 (RCK 226 and 102 
tests, as on `main`).
   
   ---
   **AI Disclosure**
   - Model: [unknown - human to fill in]
   - Platform/Tool: Claude Code
   - Human Oversight: [unknown - human to fill in]
   - Prompt Summary: Fix the flaky test REST server start seen in CI, verify 
locally.
   


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