-
Notifications
You must be signed in to change notification settings - Fork 660
chore: reduce waste in port allocations of some tests #7456
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
chore: reduce waste in port allocations of some tests #7456
Conversation
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.
mostly looks good. just a couple thoughts
for _ in 0..MAX_PORT_VERIFY_THREADS * 2 { | ||
let port_range = unique_port_range_for_tests(1); |
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.
wonder if in the future, we could release these port ranges and reuse them...
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.
we are reusing them already! just not within the same process, only with next test.
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.
ohhhh got it. misunderstood the next test setup
let (_server_port, (_, server_tcp_listener)) = | ||
bind_common_in_range_with_config(ip_addr, (2200, 2300), config).unwrap(); | ||
bind_common_in_range_with_config(ip_addr, (port_range.start, port_range.end), config) |
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.
so this function is deprecated. should we move these tests over to net-utils/src/sockets.rs
?
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.
I'll make another PR to axe the deprecated functions.
(2300, 2300 + (MAX_PORT_VERIFY_THREADS * 3) as u16), | ||
(port_range.start, port_range.end), |
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.
aren't we kind of defeating the purpose of this test if our port range is 1?
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.
The allocation of ports is not what we are testing here, this is testing the verification that they are reachable.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7456 +/- ##
=========================================
- Coverage 83.3% 83.3% -0.1%
=========================================
Files 800 800
Lines 362783 362796 +13
=========================================
- Hits 302227 302222 -5
- Misses 60556 60574 +18 🚀 New features to boost your workflow:
|
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.
lgtm!
Problem
Certain test use too many ports so we can get out-of-ports issues in CI.
This is especially a problem since we want to allocate more ports for main validator allocations as in #7455
Summary of Changes
Tame their appetite for ports a bit
This does not change any logic.