Skip to content

Commit 993d36f

Browse files
committed
Wait for free port in legal range.
This issue happens often when I ran the tests locally on my MacOS machine.
1 parent 77e1eae commit 993d36f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

redis/tests/support/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ impl RedisServer {
383383
/// process, so this must be used with care (since here we only use it for tests, it's
384384
/// mostly okay).
385385
pub fn get_random_available_port() -> u16 {
386-
for _ in 0..100 {
386+
for _ in 0..10000 {
387387
let addr = &"127.0.0.1:0".parse::<SocketAddr>().unwrap().into();
388388
let socket = Socket::new(Domain::IPV4, Type::STREAM, None).unwrap();
389389
socket.set_reuse_address(true).unwrap();

0 commit comments

Comments
 (0)