Skip to content

Commit

Permalink
Fix num_tasks == 1 assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatson committed Nov 6, 2024
1 parent a72c6a6 commit e371522
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions crates/librqbit/src/tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::{

#[tokio::test(flavor = "multi_thread", worker_threads = 64)]
async fn test_e2e_download() {
wait_until_i_am_the_last_task().await.unwrap();
let dbg_srv = spawn_debug_server();

let timeout = std::env::var("E2E_TIMEOUT")
.ok()
Expand All @@ -39,6 +39,8 @@ async fn test_e2e_download() {
.context("test_e2e_download timed out")
.unwrap();

dbg_srv.abort();

// Wait to ensure everything is dropped.
wait_until_i_am_the_last_task().await.unwrap();

Expand All @@ -52,8 +54,6 @@ async fn _test_e2e_download(drop_checks: &DropChecks) {
Err(e) => error!(error=?e, "error increasing ulimit"),
};

spawn_debug_server();

// 1. Create a torrent
// Ideally (for a more complicated test) with N files, and at least N pieces that span 2 files.

Expand Down
4 changes: 2 additions & 2 deletions crates/librqbit/src/tests/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ async fn debug_server() -> anyhow::Result<()> {
Ok(())
}

pub fn spawn_debug_server() {
tokio::spawn(debug_server());
pub fn spawn_debug_server() -> tokio::task::JoinHandle<anyhow::Result<()>> {
tokio::spawn(debug_server())
}

pub trait DropPlaceholder: Send + Sync {}
Expand Down

0 comments on commit e371522

Please sign in to comment.