run local faucet with non-overlapping ports behind test/debug gate#7736
Conversation
| /// For integration tests. Listens on a random open port and reports the port to Sender. | ||
| /// If the NEXTEST environment variable is set, a non-overlapping port is allocated instead. | ||
| pub fn run_local_faucet(faucet_keypair: Keypair, per_time_cap: Option<u64>) -> SocketAddr { | ||
| let port: u16 = match std::env::var("NEXTEST") { |
There was a problem hiding this comment.
I think a better gate to use is debug_assertions. Using NEXTEST here will still allow this to break if running under plain cargo test.
f229853 to
085a912
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #7736 +/- ##
=========================================
- Coverage 83.1% 83.1% -0.1%
=========================================
Files 808 808
Lines 356469 356479 +10
=========================================
- Hits 296288 296270 -18
- Misses 60181 60209 +28 🚀 New features to boost your workflow:
|
085a912 to
51c94f3
Compare
Thank you 🙏 |
|
looks like this PR created this warning when compiling master with any chance you could fix if you have time please? @puhtaytow |
We need to check for warnings in release builds in CI. It is by far not the first time these things slip by, impossible to catch them by hand every time. |
@gregcusack Sorry, I totally didn't think about it here is the fix #7847 |
Problem
Tests which engage ports binding are still randomly flaky.
While looking for source of the evil, i found that test_bench_tps_test_validator calls run_local_faucet which takes a port randomly.
This isn't correct behaviour as the randomly picked port might overlap with one of ports allocated thru unique_port_range_for_tests
Summary of Changes
run_local_faucet, Takes non-overlapping port for debug_assertions. Otherwise defaults to random port as before.