Skip to content

Commit

Permalink
tests: Switch to ipv4 localhost
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandru Vasile <[email protected]>
  • Loading branch information
lexnv committed Mar 18, 2024
1 parent 26b8f88 commit 32ea0ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
24 changes: 12 additions & 12 deletions src/transport/tcp/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ mod tests {
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init();

let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();

tokio::spawn(async move {
Expand Down Expand Up @@ -715,7 +715,7 @@ mod tests {
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init();

let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();

let (Ok(mut dialer), Ok((stream, dialer_address))) =
Expand Down Expand Up @@ -757,7 +757,7 @@ mod tests {
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init();

let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();

tokio::spawn(async move {
Expand Down Expand Up @@ -807,7 +807,7 @@ mod tests {
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init();

let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();

let (Ok(dialer), Ok((listener, dialer_address))) =
Expand Down Expand Up @@ -851,7 +851,7 @@ mod tests {
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init();

let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();

let (Ok(dialer), Ok((listener, dialer_address))) =
Expand Down Expand Up @@ -896,7 +896,7 @@ mod tests {
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init();

let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();

tokio::spawn(async move {
Expand Down Expand Up @@ -946,7 +946,7 @@ mod tests {
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init();

let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();

tokio::spawn(async move {
Expand Down Expand Up @@ -991,7 +991,7 @@ mod tests {
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init();

let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();

let (Ok(_dialer), Ok((listener, dialer_address))) =
Expand Down Expand Up @@ -1031,7 +1031,7 @@ mod tests {
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init();

let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();

let (Ok(dialer), Ok((listener, dialer_address))) =
Expand Down Expand Up @@ -1088,7 +1088,7 @@ mod tests {
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init();

let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();

tokio::spawn(async move {
Expand Down Expand Up @@ -1147,7 +1147,7 @@ mod tests {
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init();

let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();

let (Ok(dialer), Ok((listener, dialer_address))) =
Expand Down Expand Up @@ -1198,7 +1198,7 @@ mod tests {
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init();

let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();

tokio::spawn(async move {
Expand Down
6 changes: 3 additions & 3 deletions tests/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ async fn connect_over_dns() {
#[tokio::test]
async fn connection_timeout_tcp() {
// create tcp listener but don't accept any inbound connections
let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();
let address = Multiaddr::empty()
.with(Protocol::from(address.ip()))
Expand Down Expand Up @@ -1065,7 +1065,7 @@ async fn port_in_use_tcp() {
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init();

let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();

let _litep2p = Litep2p::new(
Expand All @@ -1087,7 +1087,7 @@ async fn port_in_use_websocket() {
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init();

let listener = TcpListener::bind("[::1]:0").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let address = listener.local_addr().unwrap();

let _litep2p = Litep2p::new(
Expand Down

0 comments on commit 32ea0ca

Please sign in to comment.