Uh oh!
There was an error while loading. Please reload this page.
Fix moto server port conflict - #292
Merged
Merged
Conversation
HonahX
approved these changes
Jan 22, 2024
HonahX
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Thanks for the fix. @kevinjqliu.
blackmwk pushed a commit
to apache/iceberg-rust
that referenced
this pull request
Jan 30, 2026
## Which issue does this PR close? - Closes #. ## What changes are included in this PR? This PR changes the default moto server port from `5000` to `5001`. Port 5000 is used by AirPlay Receiver on MacOS. The same was done in pyiceberg: apache/iceberg-python#292 ## Are these changes tested? Yes locally. I also did a global search for 5000
kevinjqliu pushed a commit
that referenced
this pull request
Aug 10, 2026
…3759) The `moto_server` session fixture hardcoded port 5001 and pre-bound a socket to it purely to detect conflicts (added in #292). This is still flaky: when tests run in parallel (e.g. multiple CI jobs on a shared runner) or when a previous run leaves the port in TIME_WAIT, the pre-bind raises `OSError: [Errno 98] Address already in use`, failing the whole test session at fixture setup. Bind to port 0 instead so the OS assigns a free ephemeral port, and read the actual bound port back via moto's `get_host_and_port()`. This removes the collision and the now-unnecessary pre-bind check (and the `socket` import). The fixture return annotation is corrected to `Generator[...]` since it yields. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 freeto 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.
This PR changes the default moto server port from
5000to5001. Port 5000 is used by AirPlay Receiver on MacOS.The
is_port_in_usefunction is used to check if the port is available first before starting the moto server. Moto server errors out silently when the port is already in use. This will cause tests to fail with client errors even though the issue is the moto server.For more details, see Issue #291