Timeout configurable

This commit is contained in:
Igor Katson 2024-08-19 13:19:56 +01:00
parent 0cb92eb333
commit 17353cf8e1
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5

View file

@ -20,12 +20,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())
let timeout = std::env::var("E2E_TIMEOUT")
.ok()
.and_then(|v| v.parse().ok())
.unwrap_or(180);
tokio::time::timeout(Duration::from_secs(timeout), _test_e2e_download())
.await
.context("test_e2e_download timed out")
.unwrap()
}