From d18f553e2d94c0e2e385e689f77e0dbbfdeb1671 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 26 Oct 2021 00:51:29 +0000 Subject: [PATCH] Extend TestBroadcastReceiver::recv timeout (#20957) (#20961) * Extend TestBroadcastReceiver timeout * Add elapsed log (cherry picked from commit 337b94b3bc744c9b199e3328254087271ac7a244) Co-authored-by: Tyera Eulberg --- rpc/src/rpc_pubsub_service.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rpc/src/rpc_pubsub_service.rs b/rpc/src/rpc_pubsub_service.rs index c98568688e..efef616bec 100644 --- a/rpc/src/rpc_pubsub_service.rs +++ b/rpc/src/rpc_pubsub_service.rs @@ -172,12 +172,16 @@ impl TestBroadcastReceiver { use std::time::{Duration, Instant}; use tokio::sync::broadcast::error::TryRecvError; - let timeout = Duration::from_millis(500); + let timeout = Duration::from_secs(5); let started = Instant::now(); loop { match self.inner.try_recv() { Ok(notification) => { + debug!( + "TestBroadcastReceiver: {:?}ms elapsed", + started.elapsed().as_millis() + ); if let Some(json) = self.handler.handle(notification).expect("handler failed") { return json.to_string(); }