Repository navigation
test(client): use an ephemeral registration port - #7184
Conversation
Aias00
left a comment
There was a problem hiding this comment.
Small but worthwhile test-hygiene fix.
The test previously did new ServerSocket(9527) — a hard-coded port that (a) collides if anything else on the CI runner is using 9527, and (b) was never closed, leaking a listening socket for the rest of the JVM's life. new ServerSocket(0) asks the OS for a free ephemeral port, and socket.getLocalPort() feeds that into the URIRegisterDTO, so the test still exercises the same code path without depending on a fixed port.
Wrapping it in try-with-resources guarantees the socket is released even if executorSubscriber.executor(...) throws, which also means a failure no longer poisons subsequent tests in the same fork.
Assertion (persistURI called once) is unchanged, so the test's intent is preserved.
|
Ping on state: this PR is approved on the code, but The path-filtered build left Please rerun the failed job; if it reproduces, a push (even a trivial rebase) re-evaluates the path filter and pulls the missing module in. |
|
@dengliming This PR is approved, but the Please rebase onto |
|
@dengliming — a correction to the note I left here yesterday. The failures on this branch all predate the fix, so nothing in your change is implicated.
That means the red checks recorded here are stale. A push — an empty commit or a rebase, whichever is easier — re-runs them against the current baseline. I would not spend time reading the old logs. |
|
Hi @dengliming, this PR is already approved, but it currently cannot be merged. Here is the blocker and what is needed: Blocker What we need Once the branch is up to date and CI is green, we will squash-merge it. Thanks! |
Fixes #6591.
Uses an OS-assigned ephemeral port and try-with-resources in the URI registration test, avoiding collisions with other processes and guaranteeing socket cleanup when assertions fail.
Tests: