From 52d8a20a843a78cbe350f5a991819d09927a418f Mon Sep 17 00:00:00 2001 From: Xiang Zhu Date: Tue, 9 Aug 2022 16:27:43 -0700 Subject: [PATCH] Increase timeout to reduce the flakyness of rpc signature receving test (#27008) * Increase timeout to reduce the flakyness of rpc signature receving test * Minor fmt fix --- rpc-test/tests/rpc.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rpc-test/tests/rpc.rs b/rpc-test/tests/rpc.rs index 89df239f6..464560a30 100644 --- a/rpc-test/tests/rpc.rs +++ b/rpc-test/tests/rpc.rs @@ -374,7 +374,13 @@ fn test_rpc_subscriptions() { } // Wait for all signature subscriptions - let deadline = Instant::now() + Duration::from_secs(15); + /* Set a large 30-sec timeout here because the timing of the above tokio process is + * highly non-deterministic. The test was too flaky at 15-second timeout. Debugging + * show occasional multi-second delay which could come from multiple sources -- other + * tokio tasks, tokio scheduler, OS scheduler. The async nature makes it hard to + * track down the origin of the delay. + */ + let deadline = Instant::now() + Duration::from_secs(30); while !signature_set.is_empty() { let timeout = deadline.saturating_duration_since(Instant::now()); match status_receiver.recv_timeout(timeout) {