carlos / platform Public

console: the size budget test covers the per-host override's no-read paths

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 0e4962dce79d726259f878409a47f05f73d15358 parent 76c1f69
1 file changed, +16 −0
  • internal/console/policysize_test.go +16 −0
diff --git a/internal/console/policysize_test.go b/internal/console/policysize_test.go
index 819123b5f..82e8e717e 100644
--- a/internal/console/policysize_test.go
+++ b/internal/console/policysize_test.go
@@ -420,4 +420,20 @@ func TestPolicySizeCheckReadsOnlyOnASizeChange(t *testing.T) {
t.Fatalf("%s made %d lists, %d ETag lists and %d gets of edges or status, want none", body, l, le, g)
}
}
+
+ // The per-host override: setting one reads; re-sending it, and
+ // removing it with value default, read nothing.
+ sizeRecord(t, fx.rel, fx.sqid, "shop", shopHost, "")
+ cs.requests()
+ r = fx.mustPut(t, "shop", `{"size":{"host":"shop-a.example.com","value":"large"}}`, policyIfMatch(r.ETag))
+ if l, _, g := cs.requests(); l == 0 || g == 0 {
+ t.Fatalf("an override made %d lists and %d gets of edges or status, want the size check's reads", l, g)
+ }
+ for _, body := range []string{`{"size":{"host":"shop-a.example.com","value":"large"}}`, `{"size":{"host":"SHOP-A.example.com","value":"large"}}`,
+ `{"size":{"host":"shop-a.example.com","value":"default"}}`, `{"size":{"host":"shop-a.example.com","value":"default"}}`} {
+ r = fx.mustPut(t, "shop", body, policyIfMatch(r.ETag))
+ if l, le, g := cs.requests(); l+le+g != 0 {
+ t.Fatalf("%s made %d lists, %d ETag lists and %d gets of edges or status, want none", body, l, le, g)
+ }
+ }
}