Skip to content

Commit

Permalink
metrics: don't hang in injection_queue_depth_multi_thread test (#6862)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn authored Sep 24, 2024
1 parent 21cf5a5 commit 82628b8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tokio/tests/rt_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,21 @@ fn injection_queue_depth_multi_thread() {

barrier1.wait();

let mut fail: Option<String> = None;
for i in 0..10 {
assert_eq!(i, metrics.injection_queue_depth());
let depth = metrics.injection_queue_depth();
if i != depth {
fail = Some(format!("{i} is not equal to {depth}"));
break;
}
rt.spawn(async {});
}

barrier2.wait();

if let Some(fail) = fail {
panic!("{fail}");
}
}

fn current_thread() -> Runtime {
Expand Down

0 comments on commit 82628b8

Please sign in to comment.