From fdacb7bc16ebbe0b17dbfa0a7396e4b1d5a869cc Mon Sep 17 00:00:00 2001 From: Ivan Date: Sun, 21 Jul 2024 15:08:23 +0200 Subject: [PATCH] Fix e2e streaming test --- crates/librqbit/src/tests/e2e_stream.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/librqbit/src/tests/e2e_stream.rs b/crates/librqbit/src/tests/e2e_stream.rs index 97c65ea..770f4d1 100644 --- a/crates/librqbit/src/tests/e2e_stream.rs +++ b/crates/librqbit/src/tests/e2e_stream.rs @@ -1,6 +1,7 @@ use std::{net::SocketAddr, time::Duration}; use anyhow::Context; +use tempfile::TempDir; use tokio::{io::AsyncReadExt, time::timeout}; use tracing::info; @@ -22,7 +23,7 @@ async fn e2e_stream() -> anyhow::Result<()> { let orig_content = std::fs::read(files.path().join("0.data")).unwrap(); let server_session = Session::new_with_opts( - "/does-not-matter".into(), + files.path().into(), crate::SessionOptions { disable_dht: true, persistence: false, @@ -63,8 +64,10 @@ async fn e2e_stream() -> anyhow::Result<()> { server_session.tcp_listen_port().unwrap(), ); + let client_dir = TempDir::with_prefix("test_e2e_stream_client")?; + let client_session = Session::new_with_opts( - "/does-not-matter".into(), + client_dir.path().into(), crate::SessionOptions { disable_dht: true, persistence: false,