Skip to content

Backport(v1.19): test_out_http: use an unused port for each test case (#5618) - #5639

Merged
Watson1978 merged 1 commit into
v1.19from
backport-to-v1.19/pr5618
Nov 15, 2026
Merged

Watson1978 merged 1 commit into
v1.19from
backport-to-v1.19/pr5618

Conversation

@github-actions

Copy link
Copy Markdown

Which issue(s) this PR fixes:
Backport #5618
Fixes #

What this PR does / why we need it:

The HTTP server thread was kept in a class variable, and it is shared with sub test cases. Each sub test case set it to nil at startup, so the server of the parent test case was never stopped and kept port
19880. The dynamic endpoint host validation tests used the same port, so their server could not bind it.

Fixed ports can also conflict with other processes or with tests that run in parallel.

Before: The server thread died with "Address already in use -
bind(2) for 127.0.0.1:19880 (Errno::EADDRINUSE)".
After: Each test case keeps its own server in a class instance
variable, and uses a port from unused_port.

Docs Changes:

N/A

Release Note:

N/A

**Which issue(s) this PR fixes**:
Fixes #

**What this PR does / why we need it**:

The HTTP server thread was kept in a class variable, and it is shared
with sub test cases. Each sub test case set it to nil at startup, so the
server of the parent test case was never stopped and kept port
19880. The dynamic endpoint host validation tests used the same port, so
their server could not bind it.

Fixed ports can also conflict with other processes or with tests that
run in parallel.

Before: The server thread died with "Address already in use -
        bind(2) for 127.0.0.1:19880 (Errno::EADDRINUSE)".
After: Each test case keeps its own server in a class instance
       variable, and uses a port from unused_port.

**Docs Changes**:

N/A

**Release Note**:

N/A

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@Watson1978 Watson1978 added the CI Test/CI issues label Nov 15, 2026
@Watson1978 Watson1978 added this to the v1.19.5 milestone Nov 15, 2026
@Watson1978
Watson1978 merged commit 85d70d7 into v1.19 Nov 15, 2026
21 checks passed
@Watson1978
Watson1978 deleted the backport-to-v1.19/pr5618 branch November 15, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Test/CI issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants