diff --git a/crates/scion/src/socket/udp.rs b/crates/scion/src/socket/udp.rs index eff3488..d44663e 100644 --- a/crates/scion/src/socket/udp.rs +++ b/crates/scion/src/socket/udp.rs @@ -427,12 +427,15 @@ mod tests { } macro_rules! async_test_case { - ($name:ident: $func:ident($($arg:expr),*)) => { + ($name:ident($timeout:expr): $func:ident($($arg:expr),*)) => { #[tokio::test] async fn $name() -> TestResult { - $func($($arg,)*).await + tokio::time::timeout(std::time::Duration::from_secs($timeout),$func($($arg,)*)).await.unwrap() } }; + ($name:ident: $($tail:tt)*) => { + async_test_case!($name(1): $($tail)*); + }; } const MESSAGE: &[u8] = b"Hello World! Hello World! Hello World!";