set non-overlapping port to faucet in JsonRpcConfig default_for_tests#7741
set non-overlapping port to faucet in JsonRpcConfig default_for_tests#7741puhtaytow wants to merge 1 commit intoanza-xyz:masterfrom
Conversation
|
If this PR represents a change to the public RPC API:
Thank you for keeping the RPC clients in sync with the server API @puhtaytow. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7741 +/- ##
=========================================
- Coverage 83.0% 83.0% -0.1%
=========================================
Files 812 812
Lines 357065 357069 +4
=========================================
- Hits 296700 296673 -27
- Misses 60365 60396 +31 🚀 New features to boost your workflow:
|
|
This looks appropriate, but I do not know much about faucets and possible side effects |
| faucet_addr: Some(SocketAddr::new( | ||
| IpAddr::V4(Ipv4Addr::LOCALHOST), | ||
| unique_port_range_for_tests(1).start, | ||
| )), |
There was a problem hiding this comment.
i think you want to address port the issue here instead (may be other places too):
Lines 346 to 354 in 996570b
from my understanding, this faucet_addr in this default_for_tests() appears to always get overwritten by some passed in faucet_addr, so setting the socketaddr here won't do anything.
There was a problem hiding this comment.
It might be strange coincidence, but i observed changes in default_for_tests() having impact on how many tests bind at random high port. I'll investigate more, turning it draft for now. Thank you.
Problem
Tests that engage ports binding are flaky. This is continuation of #7736
The JsonRpcConfig default_for_tests doesn't take ports from unique_port_range_for_tests in faucet case.
Summary of Changes
JsonRpcConfig::default_for_testsnow populate socket with port taken from unique_port_range_for_tests range.