From 61dbff329264d1c756387cd1343833eb30acbeb2 Mon Sep 17 00:00:00 2001 From: Benjamin Woodruff Date: Thu, 29 Aug 2024 12:25:32 -0700 Subject: [PATCH] Add comment to timeout --- turbopack/crates/turbo-tasks-testing/tests/detached.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/turbopack/crates/turbo-tasks-testing/tests/detached.rs b/turbopack/crates/turbo-tasks-testing/tests/detached.rs index b8210b269b912..5011df99f7a77 100644 --- a/turbopack/crates/turbo-tasks-testing/tests/detached.rs +++ b/turbopack/crates/turbo-tasks-testing/tests/detached.rs @@ -12,6 +12,7 @@ static REGISTRATION: Registration = register!(); #[tokio::test] async fn test_spawns_detached() -> anyhow::Result<()> { run(®ISTRATION, || async { + // timeout: prevent the test from hanging, and fail instead if this is broken timeout(Duration::from_secs(5), async { let notify = TransientInstance::new(Notify::new()); let (tx, mut rx) = watch::channel(None); @@ -60,6 +61,7 @@ async fn spawns_detached( #[tokio::test] async fn test_spawns_detached_changing() -> anyhow::Result<()> { run(®ISTRATION, || async { + // timeout: prevent the test from hanging, and fail instead if this is broken timeout(Duration::from_secs(5), async { let (tx, mut rx) = watch::channel(None); let tx = TransientInstance::new(tx);