Skip to content

Commit 8c798d4

Browse files
pablorfb-metafacebook-github-bot
authored andcommitted
Fix number of messages being waited on
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 8c62bec commit 8c798d4

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

hyperactor_mesh/benches/main.rs

Lines changed: 14 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

@@ -167,7 +172,12 @@ fn bench_actor_mesh_message_sizes(c: &mut Criterion) {
167172

168173
let mut msg_rcv = 0;
169174
while msg_rcv < actor_count {
170-
let _ = rx.recv().await.unwrap();
175+
tokio::select! {
176+
_ = rx.recv() => {}
177+
_ = tokio::time::sleep(Duration::from_secs(10)) => {
178+
panic!("Timed out. Expected {} messages but got {}", host_count, msg_rcv);
179+
}
180+
}
171181
msg_rcv += 1;
172182
}
173183
}

0 commit comments

Comments
 (0)