Skip to content

Commit 66d2a88

Browse files
committed
test: increase timeout
1 parent db8edd0 commit 66d2a88

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

crates/tuic-tests/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ pub async fn test_udp_through_socks5(
218218
info!("[{}] Waiting for echo response...", test_name);
219219

220220
let mut buffer = vec![0u8; 1024];
221-
match timeout(Duration::from_secs(2), socks.recv_from(&mut buffer)).await {
221+
match timeout(Duration::from_secs(5), socks.recv_from(&mut buffer)).await {
222222
Ok(Ok((len, addr))) => {
223223
info!("[{}] Received {} bytes from {:?}", test_name, len, addr);
224224
info!("[{}] Response data: {:?}", test_name, &buffer[..len]);

crates/wind-test/src/socks5.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ mod tests {
735735

736736
// Signal the echo server to stop
737737
echo_server_running.store(false, Ordering::Relaxed);
738-
match tokio::time::timeout(Duration::from_secs(2), echo_task).await {
738+
match tokio::time::timeout(Duration::from_secs(5), echo_task).await {
739739
Ok(_) => {}
740740
Err(_) => panic!("Echo server stop timeout in test_udp_through_proxy"),
741741
}
@@ -841,7 +841,7 @@ mod tests {
841841
println!("✗ Direct UDP echo test failed: {}", e);
842842
// Signal the echo server to stop
843843
echo_server_running.store(false, Ordering::Relaxed);
844-
let _ = tokio::time::timeout(std::time::Duration::from_secs(1), echo_task).await;
844+
let _ = tokio::time::timeout(std::time::Duration::from_secs(5), echo_task).await;
845845
panic!("Echo server is not working correctly");
846846
}
847847
}
@@ -895,7 +895,7 @@ mod tests {
895895
echo_server_running.store(false, Ordering::Relaxed);
896896

897897
// Wait for the echo server to finish (with timeout)
898-
match tokio::time::timeout(std::time::Duration::from_secs(2), echo_task).await {
898+
match tokio::time::timeout(std::time::Duration::from_secs(5), echo_task).await {
899899
Ok(_) => println!("✓ Echo server stopped successfully"),
900900
Err(_) => panic!("Echo server stop timeout in test_udp_large_packet_through_proxy"),
901901
}
@@ -929,7 +929,7 @@ mod tests {
929929

930930
// Receive response
931931
let mut buffer = vec![0u8; packet_size + 100];
932-
let (len, _) = tokio::time::timeout(std::time::Duration::from_secs(2), test_socket.recv_from(&mut buffer)).await??;
932+
let (len, _) = tokio::time::timeout(std::time::Duration::from_secs(5), test_socket.recv_from(&mut buffer)).await??;
933933

934934
if len == test_packet.len() && buffer[..len] == test_packet {
935935
Ok(())
@@ -1041,7 +1041,7 @@ mod tests {
10411041

10421042
// Signal the echo server to stop
10431043
echo_server_running.store(false, Ordering::Relaxed);
1044-
let _ = tokio::time::timeout(std::time::Duration::from_secs(2), echo_task).await;
1044+
let _ = tokio::time::timeout(std::time::Duration::from_secs(5), echo_task).await;
10451045
}
10461046

10471047
#[tokio::test]
@@ -1135,7 +1135,7 @@ mod tests {
11351135
println!("⚠ SOCKS5 server does not support UDP ASSOCIATE - skipping remaining tests");
11361136
// Signal the echo server to stop
11371137
echo_server_running.store(false, Ordering::Relaxed);
1138-
let _ = tokio::time::timeout(std::time::Duration::from_secs(1), echo_task).await;
1138+
let _ = tokio::time::timeout(std::time::Duration::from_secs(5), echo_task).await;
11391139
// Cleanup proxy server
11401140
ctx.token.cancel();
11411141
let _ = tokio::time::timeout(Duration::from_secs(5), ctx.tasks.wait()).await;
@@ -1151,7 +1151,7 @@ mod tests {
11511151
echo_server_running.store(false, Ordering::Relaxed);
11521152

11531153
// Wait for the echo server to finish (with timeout)
1154-
match tokio::time::timeout(std::time::Duration::from_secs(2), echo_task).await {
1154+
match tokio::time::timeout(std::time::Duration::from_secs(5), echo_task).await {
11551155
Ok(_) => println!("✓ Echo server stopped successfully"),
11561156
Err(_) => panic!("Echo server stop timeout in test_udp_multiple_mtu_sizes"),
11571157
}

0 commit comments

Comments
 (0)