From 7db75a607553ce2e464885c323dd784ca6badf6e Mon Sep 17 00:00:00 2001 From: npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Date: Sat, 1 Aug 2026 14:31:06 -0400 Subject: [PATCH] test(relay): seed owner-limit loop from max_communities_per_owner() fresh_host_at_owner_limit_returns_limit_reached_conflict looped over the MAX_COMMUNITIES_PER_OWNER constant while provision_community enforces max_communities_per_owner(), which reads BUZZ_MAX_COMMUNITIES_PER_OWNER with the constant only as fallback. Latent today (nothing wires the env), but the moment an operator sets it the test provisions the wrong count and the CONFLICT assertion inverts. Same defect class as the two limit tests fixed in the previous commit: literal-vs-const there, const-vs-env here. Found by Sami. Verified RED/GREEN with BUZZ_MAX_COMMUNITIES_PER_OWNER=3: before, the loop runs 5 while the code enforces 3 (409 at iteration 4); after, the test passes at env=3, env=7, and default. Co-authored-by: Tyler <109685178+tlongwell-block@users.noreply.github.com> Signed-off-by: Tyler <109685178+tlongwell-block@users.noreply.github.com> --- crates/buzz-relay/src/api/operator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/buzz-relay/src/api/operator.rs b/crates/buzz-relay/src/api/operator.rs index 5b69a43874..503e01f0f0 100644 --- a/crates/buzz-relay/src/api/operator.rs +++ b/crates/buzz-relay/src/api/operator.rs @@ -1083,7 +1083,7 @@ mod tests { return; }; - for _ in 0..buzz_db::relay_members::MAX_COMMUNITIES_PER_OWNER { + for _ in 0..buzz_db::relay_members::max_communities_per_owner() { let host = format!("community-{}.example", Uuid::new_v4().simple()); assert_eq!( provision_community(state.clone(), &operator, &host, &owner)