Skip to content

Commit a0ccf07

Browse files
dulinrileymeta-codesync[bot]
authored andcommitted
Make test_actor_ledger more reliable (#1948)
Summary: Pull Request resolved: #1948 Fixing this error: ``` running 1 test test proc::tests::test_actor_ledger ... FAILED failures: failures: proc::tests::test_actor_ledger test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 217 filtered out; finished in 0.01s stderr ─── thread '<unnamed>' panicked at hyperactor/src/proc.rs:2745:13: assertion `left == right` failed left: {ActorId(Ranked(WorldId("local"), 0), "root", 0): ActorTreeSnapshot { pid: 0, type_name: "hyperactor::proc::tests::TestActor", status: Idle, stats: ActorStats { num_processed_messages: 2 }, handlers: {}, children: {3: ActorTreeSnapshot { pid: 3, type_name: "hyperactor::proc::tests::TestActor", status: Idle, stats: ActorStats { num_processed_messages: 0 }, handlers: {}, children: {}, events: [], spans: [] }}, events: [], spans: [] }} right: {ActorId(Ranked(WorldId("local"), 0), "root", 0): ActorTreeSnapshot { pid: 0, type_name: "hyperactor::proc::tests::TestActor", status: Idle, stats: ActorStats { num_processed_messages: 3 }, handlers: {}, children: {3: ActorTreeSnapshot { pid: 3, type_name: "hyperactor::proc::tests::TestActor", status: Idle, stats: ActorStats { num_processed_messages: 0 }, handlers: {}, children: {}, events: [], spans: [] }}, events: [], spans: [] }} note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` The num_processed_messages might still increase until the root is idle (as it processes signals as well as messages). Reviewed By: mariusae Differential Revision: D87499544 fbshipit-source-id: 542fdb640ec8e3e64e049f3e2bdcc5be62899480
1 parent aa460ae commit a0ccf07

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hyperactor/src/proc.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2731,6 +2731,8 @@ mod tests {
27312731
// Stop root_1. This should remove it, and its child, from snapshot.
27322732
root_1.drain_and_stop().unwrap();
27332733
root_1.await;
2734+
// root also needs to stop processing messages to get a reliable number.
2735+
wait_until_idle(&root).await;
27342736
{
27352737
let snapshot = proc.state().ledger.snapshot();
27362738
assert_eq!(

0 commit comments

Comments
 (0)