From d80b0b3d8a76c52813b728061597d50bb06d271c Mon Sep 17 00:00:00 2001 From: "K. Isom" Date: Thu, 24 Sep 2026 14:56:58 -0700 Subject: [PATCH] gatewayd: serve_answers waits for every reply it reads nobody_else_and_nothing_else_answers_it read five replies after waiting only for the first, so it failed whenever the other four were not posted yet. It failed once in a full `make gate` run, when many test binaries ran at once. The helper now waits for as many posts as the test reads. The M4b plan's copy is left as it was handed over. Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/gatewayd/tests/serve_answers.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/gatewayd/tests/serve_answers.rs b/crates/gatewayd/tests/serve_answers.rs index 0a343e7..eaacc17 100644 --- a/crates/gatewayd/tests/serve_answers.rs +++ b/crates/gatewayd/tests/serve_answers.rs @@ -105,10 +105,13 @@ impl Stage { .posted(&post(&id('c', n), user, DM, root, text, at), "D"); } - /// The text posted in the thread after the approval, within five seconds. - fn replies(&self, after: usize) -> Vec { - let posts = self.mm.wait_posts(after + 1, WAIT); - posts[after..].iter().map(|(_, _, t)| t.clone()).collect() + /// The first `count` posts after the first `after`, waiting up to five seconds for all of them. + fn replies(&self, after: usize, count: usize) -> Vec { + let posts = self.mm.wait_posts(after + count, WAIT); + posts[after..after + count] + .iter() + .map(|(_, _, t)| t.clone()) + .collect() } } @@ -193,7 +196,7 @@ fn nobody_else_and_nothing_else_answers_it() { s.command(4, KYLE, &root, "!approve 7", 7); s.command(5, KYLE, &root, "!approve 42 please", 8); assert_eq!( - s.replies(1)[..5], + s.replies(1, 5), [ NOT_APPROVER.to_string(), "approval 42 is answered in its own thread".to_string(),