mirror of
https://github.com/block/buzz.git
synced 2026-11-13 12:51:34 +00:00
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>
This commit is contained in:
parent
8fd5ab04d1
commit
7db75a6075
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user