* Extend TestBroadcastReceiver timeout
* Add elapsed log
(cherry picked from commit 337b94b3bc
)
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
This commit is contained in:
@ -172,12 +172,16 @@ impl TestBroadcastReceiver {
|
|||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
use tokio::sync::broadcast::error::TryRecvError;
|
use tokio::sync::broadcast::error::TryRecvError;
|
||||||
|
|
||||||
let timeout = Duration::from_millis(500);
|
let timeout = Duration::from_secs(5);
|
||||||
let started = Instant::now();
|
let started = Instant::now();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
match self.inner.try_recv() {
|
match self.inner.try_recv() {
|
||||||
Ok(notification) => {
|
Ok(notification) => {
|
||||||
|
debug!(
|
||||||
|
"TestBroadcastReceiver: {:?}ms elapsed",
|
||||||
|
started.elapsed().as_millis()
|
||||||
|
);
|
||||||
if let Some(json) = self.handler.handle(notification).expect("handler failed") {
|
if let Some(json) = self.handler.handle(notification).expect("handler failed") {
|
||||||
return json.to_string();
|
return json.to_string();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user