Skip to content

Commit 0dc006e

Browse files
pablorfb-metafacebook-github-bot
authored andcommitted
Fix number of messages being waited on (#855)
Summary: Previously we were not waiting for all messages being casted (missing GPU) Suprisingly this caused the job to hang Differential Revision: D80187064
1 parent 3db8984 commit 0dc006e

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

hyperactor_mesh/benches/main.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,13 @@ fn bench_actor_scaling(c: &mut Criterion) {
7474
.unwrap();
7575

7676
let mut msg_rcv = 0;
77-
while msg_rcv < host_count {
78-
let _ = rx.recv().await.unwrap();
77+
while msg_rcv < host_count * 8 {
78+
tokio::select! {
79+
_ = rx.recv() => {}
80+
_ = tokio::time::sleep(Duration::from_secs(10)) => {
81+
panic!("Timed out. Expected {} messages but got {}", host_count, msg_rcv);
82+
}
83+
}
7984
msg_rcv += 1;
8085
}
8186
}
@@ -89,7 +94,7 @@ fn bench_actor_scaling(c: &mut Criterion) {
8994
.await
9095
.expect("Failed to stop allocator");
9196
elapsed
92-
});
97+
})
9398
});
9499
}
95100

@@ -154,6 +159,7 @@ fn bench_actor_mesh_message_sizes(c: &mut Criterion) {
154159
let payload = vec![0u8; message_size];
155160

156161
actor_mesh
162+
157163
.cast(
158164
client,
159165
all(true_()),
@@ -167,7 +173,12 @@ fn bench_actor_mesh_message_sizes(c: &mut Criterion) {
167173

168174
let mut msg_rcv = 0;
169175
while msg_rcv < actor_count {
170-
let _ = rx.recv().await.unwrap();
176+
tokio::select! {
177+
_ = rx.recv() => {}
178+
_ = tokio::time::sleep(Duration::from_secs(10)) => {
179+
panic!("Timed out. Expected {} messages but got {}", actor_count, msg_rcv);
180+
}
181+
}
171182
msg_rcv += 1;
172183
}
173184
}

0 commit comments

Comments
 (0)