diff --git a/crates/gatewayd/tests/serve_restart.rs b/crates/gatewayd/tests/serve_restart.rs index 39442d8..bf366e2 100644 --- a/crates/gatewayd/tests/serve_restart.rs +++ b/crates/gatewayd/tests/serve_restart.rs @@ -41,12 +41,14 @@ fn a_restart_reports_the_cut_off_turn_and_catches_up() { ); let _running = start(config(&home, &mm.url(), "")); let _ws = mm.next_ws(WAIT); - let first = turns.recv_timeout(WAIT).unwrap(); - let second = turns.recv_timeout(WAIT).unwrap(); - assert_eq!( - (first.content.as_str(), second.content.as_str()), - ("first", "second") - ); + // Two top-level posts are two sessions, whose turns run on their own threads: they may reach + // `loopd` in either order. The order of catch-up itself is `mm_json.rs`'s to check. + let mut got = [ + turns.recv_timeout(WAIT).unwrap().content, + turns.recv_timeout(WAIT).unwrap().content, + ]; + got.sort(); + assert_eq!(got, ["first", "second"]); let posts = mm.wait_posts(3, WAIT); assert_eq!(posts[0], (DM.to_string(), cut, INTERRUPTED.to_string())); assert_eq!(posts.len(), 3, "{posts:?}");