From 7d00d72baa6fa62ff2cd64677176a8e74400d759 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Wed, 4 Aug 2021 10:52:53 +0100 Subject: [PATCH] Small tweak to make it more obvious when feeds are disconnected --- backend/telemetry_core/tests/soak_tests.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/telemetry_core/tests/soak_tests.rs b/backend/telemetry_core/tests/soak_tests.rs index 0202fb6..616815a 100644 --- a/backend/telemetry_core/tests/soak_tests.rs +++ b/backend/telemetry_core/tests/soak_tests.rs @@ -132,7 +132,7 @@ async fn run_soak_test(opts: SoakTestOpts) { // Start sending "update" messages from nodes at time intervals. let bytes_in = Arc::new(AtomicUsize::new(0)); let bytes_in2 = Arc::clone(&bytes_in); - let send_handle = tokio::task::spawn(async move { + tokio::task::spawn(async move { let msg = json!({ "id":1, "payload":{ @@ -175,6 +175,7 @@ async fn run_soak_test(opts: SoakTestOpts) { bytes_out.fetch_add(num_bytes, Ordering::Relaxed); msgs_out.fetch_add(1, Ordering::Relaxed); } + eprintln!("Error: feed has been closed unexpectedly"); }); } @@ -209,8 +210,8 @@ async fn run_soak_test(opts: SoakTestOpts) { } }); - // Wait for sending to finish before ending. - send_handle.await.unwrap(); + // Wait forever. + future::pending().await } /// Identical to `soak_test`, except that we try to send realistic messages from fake nodes. @@ -318,6 +319,7 @@ async fn run_realistic_soak_test(opts: SoakTestOpts) { bytes_out.fetch_add(num_bytes, Ordering::Relaxed); msgs_out.fetch_add(1, Ordering::Relaxed); } + eprintln!("Error: feed has been closed unexpectedly"); }); }