Skip to content

Start CLI test servers outside the ephemeral port range - #549

Merged
dotsdl merged 1 commit into
mainfrom
ci-cli-test-ports
Nov 30, 2026
Merged

dotsdl merged 1 commit into
mainfrom
ci-cli-test-ports

Conversation

@dotsdl

@dotsdl dotsdl commented Nov 30, 2026

Copy link
Copy Markdown
Member

The CLI tests in test_cli.py fail intermittently with "The test server could not be reached": on main after #542, on #543, and on main on 2026-09-08. gunicorn logged Address already in use for port 50100.

Those tests start servers on ports 50100 and 50200, inside Linux's ephemeral port range (32768–60999), which outgoing connections elsewhere in the tests take their local ports from. If one of them holds the port when the server starts, gunicorn can't bind it. test_api and test_api_application also use the same port on every xdist worker.

This moves the CLI test servers to 10000 and 12000 plus the usual per-worker offset, below the ephemeral range like the other test servers.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TzQGiBpTqsvrNituexCQB1

The CLI tests started API servers on ports 50100 and 50200, inside
Linux's ephemeral range (32768-60999), from which outgoing connections
elsewhere in the tests take their local ports. When one held the port,
gunicorn couldn't bind it and the test failed with "The test server
could not be reached". test_api and test_api_application also used a
fixed port on every worker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TzQGiBpTqsvrNituexCQB1
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.53%. Comparing base (065a821) to head (55f741f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #549      +/-   ##
==========================================
- Coverage   91.57%   91.53%   -0.04%     
==========================================
  Files          31       31              
  Lines        5044     5044              
==========================================
- Hits         4619     4617       -2     
- Misses        425      427       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dotsdl
dotsdl merged commit 0862c5c into main Nov 30, 2026
6 of 7 checks passed
@dotsdl
dotsdl deleted the ci-cli-test-ports branch November 30, 2026 23:31
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.

1 participant