Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metrics: don't hang in injection_queue_depth_multi_thread test #6862

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
metrics: don't hang in injection_queue_depth_multi_thread test
  • Loading branch information
Darksonn committed Sep 23, 2024
commit 345e5a4075bd432510659d818ccc6e97d266bbb1
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
Loading