Skip to content

Stabilize gateway test port allocation - #95

Merged
lucarlig merged 1 commit into
mainfrom
user/luca/stabilize-gateway-test-ports
Aug 18, 2026
Merged

Stabilize gateway test port allocation#95
lucarlig merged 1 commit into
mainfrom
user/luca/stabilize-gateway-test-ports

Conversation

@lucarlig

@lucarlig lucarlig commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • bind mock upstream listeners to 127.0.0.1:0 before publishing their ports
  • retain the listeners until each Axum server starts
  • keep selected ports unique and separate from the gateway listener
  • propagate listener and server failures through the test result

Why this is needed

The previous helper asked the operating system for an unused port and released it before Axum bound the server. Parallel integration tests could claim that port in the gap, causing intermittent AddrInUse failures unrelated to the behavior under test.

Binding port zero and retaining the returned listener removes that time-of-check/time-of-use race. This changes test infrastructure only; production dataplane behavior is unchanged.

Stack

This is the base layer of native GitHub stack #100. PR #97 contains the task-handle implementation above it. This PR's review diff against main is limited to tests/support/list_tools_gateway.rs.

Validation

  • cargo fmt --all -- --check
  • cargo test --locked -p contextforge-data-plane-lib --test gateway_list_tools — 2 passed
  • git diff --check origin/main...HEAD

@lucarlig
lucarlig force-pushed the user/luca/stabilize-gateway-test-ports branch from de44c04 to 70605f4 Compare August 18, 2026 08:56
@lucarlig
lucarlig changed the base branch from main to user/luca/issue-6185-task-handles August 18, 2026 08:57
@lucarlig
lucarlig marked this pull request as ready for review August 18, 2026 08:57
@lucarlig lucarlig self-assigned this Aug 18, 2026
dawid-nowak
dawid-nowak previously approved these changes Aug 18, 2026
@lucarlig
lucarlig force-pushed the user/luca/stabilize-gateway-test-ports branch from 70605f4 to ea13eb8 Compare August 18, 2026 09:19
@dawid-nowak
dawid-nowak self-requested a review August 18, 2026 09:22
@lucarlig
lucarlig changed the base branch from user/luca/issue-6185-task-handles to main August 18, 2026 09:23
Signed-off-by: lucarlig <luca.carlig@ibm.com>
(cherry picked from commit 4653f8f)
@lucarlig
lucarlig force-pushed the user/luca/stabilize-gateway-test-ports branch from ea13eb8 to 793db5a Compare August 18, 2026 09:24
@lucarlig
lucarlig merged commit 2897481 into main Aug 18, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants