Skip to content

Commit 3fe89db

Browse files
committed
Add comment about a potential race condition
1 parent b9645f1 commit 3fe89db

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/common.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ fn init_log() -> StdErrLog {
222222
}
223223

224224
fn rand_available_addr() -> net::SocketAddr {
225+
// note this has a potential but unlikely race condition, if the port is grabbed before the caller binds it
225226
let socket = net::UdpSocket::bind("127.0.0.1:0").unwrap();
226227
socket.local_addr().unwrap()
227228
}

0 commit comments

Comments
 (0)