Extend TestBroadcastReceiver::recv timeout (#20957)

* Extend TestBroadcastReceiver timeout

* Add elapsed log
This commit is contained in:
Tyera Eulberg 2021-10-25 16:44:53 -06:00 committed by GitHub
parent bbe3ce3db5
commit 337b94b3bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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();
}