From 8e2aed5968b72135d2ef4ff83ee5da51f16a7d76 Mon Sep 17 00:00:00 2001 From: AzureMarker Date: Tue, 21 Dec 2021 11:42:22 -0500 Subject: [PATCH] Add a test to ensure tasks are balanced across workers --- tokio-util/tests/spawn_pinned.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tokio-util/tests/spawn_pinned.rs b/tokio-util/tests/spawn_pinned.rs index 728e3477768..08fff542b9e 100644 --- a/tokio-util/tests/spawn_pinned.rs +++ b/tokio-util/tests/spawn_pinned.rs @@ -180,7 +180,7 @@ async fn tasks_are_balanced() { let thread_id1 = join_handle1.await.unwrap(); let thread_id2 = join_handle2.await.unwrap(); - println!("{:?} {:?}", thread_id1, thread_id2); - + // Since the first task was active when the second task spawned, they should + // be on separate workers/threads. assert_ne!(thread_id1, thread_id2); }