Repository navigation
Start CLI test servers outside the ephemeral port range - #549
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CLI tests in
test_cli.pyfail intermittently with "The test server could not be reached": onmainafter #542, on #543, and onmainon 2026-09-08. gunicorn loggedAddress already in usefor 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_apiandtest_api_applicationalso 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