From 6e92eec167b6ad2be888139b565852e92c67e43d Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Mon, 19 Aug 2024 12:08:46 +0100 Subject: [PATCH] global timeout in e2e test --- crates/librqbit/src/tests/e2e.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/librqbit/src/tests/e2e.rs b/crates/librqbit/src/tests/e2e.rs index abce8f9..e7ec84a 100644 --- a/crates/librqbit/src/tests/e2e.rs +++ b/crates/librqbit/src/tests/e2e.rs @@ -18,8 +18,16 @@ use crate::{ AddTorrentOptions, AddTorrentResponse, Session, SessionOptions, }; +const TIMEOUT_SECS: u64 = 180; + #[tokio::test(flavor = "multi_thread", worker_threads = 64)] async fn test_e2e_download() { + tokio::time::timeout(Duration::from_secs(TIMEOUT_SECS), _test_e2e_download()) + .await + .unwrap() +} + +async fn _test_e2e_download() { let _ = tracing_subscriber::fmt::try_init(); // 1. Create a torrent