forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
net-utils (& others): swap tests to non-overlapping port allocation #6957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
puhtaytow
wants to merge
27
commits into
anza-xyz:master
from
puhtaytow:swap-bind_to_unspecified-to-bind_to-in-tests-0
Closed
Changes from 20 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
9eea7cf
move to bind_to / bind_to_async / ditch bind_to_unspecified/ async
puhtaytow a26d7d5
swap remaining tests
puhtaytow d498b42
inline bind_to in meta
puhtaytow a45ca39
support range and single ports scenarios
puhtaytow 66e0081
fix typo
puhtaytow 073dee6
move tests to new bind_to api
puhtaytow a6dd863
fix import
puhtaytow c50db86
move to new unique api
puhtaytow c396d24
finish it
puhtaytow f62e018
cosmetics / bring docs part / change function names to more explicit
puhtaytow 975fa39
remove obsolete function
puhtaytow ccb3dac
simplify the code
puhtaytow 2d489d6
further reduce code
puhtaytow 5140795
more explicit function naming
puhtaytow 5123fea
reduce even more code
puhtaytow 993e52c
adjust func name
puhtaytow 98b8402
fix docs
puhtaytow 9f0b88a
remove remaining bind_to
puhtaytow ee6aef8
bring removed import
puhtaytow ff43cf2
Merge pull request #2 from puhtaytow/swap-bind_to_unspecified-to-bind…
puhtaytow 807dce4
allocate single port instead of many for cases that don't need more t…
puhtaytow 4d2894b
move to range / adjust code
puhtaytow b5e1bc0
cleanup
puhtaytow f836247
cleanup round 2
puhtaytow 738c73a
cleanup round 3
puhtaytow 47c0048
add deprecation for bind_to_unspecified
puhtaytow 796b912
remove the deprecation of bind_to_unspecified / too many things to fi…
puhtaytow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have an off by one error here? If start is 10000, and i want 20 ports, i get back
(10000, 10020)which is 21 ports.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good question, i wasn't confident enough so decided to check it with the test and the code below pass positively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well ya the difference between 10020 and 10000 is 20. but if we return both of them, the user will use them all. but that is 21 ports returned even though the difference is 20.
in your example above, if i use every port from
pr_etopr_s, that is 21 ports. if we count it out: 0, 1, 2, 3, ..., 19, 20. that is 21.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, would you suggest to add note in the function docs or maybe return Range? instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switching to range would be great, yes. Since this is a new function we might as well have proper API for it.