fix(tests): use portpicker for ephemeral port in default_role_integration_test#933
Open
AlexMikhalev wants to merge 1 commit into
Open
fix(tests): use portpicker for ephemeral port in default_role_integration_test#933AlexMikhalev wants to merge 1 commit into
AlexMikhalev wants to merge 1 commit into
Conversation
…tion_test Hardcoded port 8085 caused intermittent "Address already in use (os error 98)" failures when the OS had not yet released the port from a prior test run. Replace with portpicker::pick_unused_port() following the pattern already used in tests/server.rs. portpicker is already a crate dependency. Refs #2947 Co-Authored-By: Terraphim AI <noreply@terraphim.ai>
8b626dd to
757c68b
Compare
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.
Summary
8085interraphim_server/tests/default_role_integration_test.rswithportpicker::pick_unused_port().portpickeris already a crate dependency (in[dependencies], used bytests/server.rs).Root cause
"127.0.0.1:8085".parse().unwrap()is a fixed address. When the OS kernel has not fully released the port from a previous test run,TcpListener::bindfails withEADDRINUSE(os error 98), producing a flakyServer error: ApiError(500, Address already in use). The pattern was already established correctly intests/server.rs.Verification
Refs terraphim/terraphim-ai#2947 (Gitea)