edge: the ineligible-routes table refuses a dispatch to a real route
The row now names a second route with no path rows, so only the dispatch check refuses it (a mutation dropping that check survived).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+17
−1
internal/edge/pagecache_test.go+17 −1
Intent
Attributed to this commit: 22.8 g CO₂e (2,943,045 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on edge-page-cache-1, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/internal/edge/pagecache_test.go b/internal/edge/pagecache_test.go| index 5f0463079..b7051f528 100644 |
| --- a/internal/edge/pagecache_test.go |
| +++ b/internal/edge/pagecache_test.go |
| @@ -999,6 +999,22 @@ func TestPageThrottledAccountBypasses(t *testing.T) { |
| func TestPageIneligibleRoutes(t *testing.T) { |
| s := newPCScene(t, pageOK(pcBody)) |
| + // A second route with no path rows, so a request for pcHost dispatched |
| + // to it is refused for the dispatch alone. |
| + if err := s.reg.Upsert(registry.Route{Host: "other.example.com", Kind: "instance", Addr: s.b.srv.Listener.Addr().String(), |
| + Status: "ready", Account: "abc", App: "other", Version: pcBuild}); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := s.e.Reload(); err != nil { |
| + t.Fatal(err) |
| + } |
| + other, ok := s.e.current()["other.example.com"] |
| + if !ok { |
| + t.Fatal("no upstream for the second route") |
| + } |
| + if _, ok := s.e.pageRouteEligible("other.example.com", "/p", other); !ok { |
| + t.Fatal("the second route is not eligible on its own hostname") |
| + } |
| base, ok := s.e.current()[pcHost] |
| if !ok { |
| t.Fatal("no upstream") |
| @@ -1022,7 +1038,7 @@ func TestPageIneligibleRoutes(t *testing.T) { |
| {"import gate", func(up *upstream) { up.route.ImportGate = "import-1" }, "/p"}, |
| {"pages off", func(up *upstream) { up.route.PagesOff = true }, "/p"}, |
| {"via tunnel", func(up *upstream) { up.viaTunnel = true }, "/p"}, |
| - {"another route's dispatch", func(up *upstream) { up.route.Host = "other.example.com" }, "/p"}, |
| + {"another route's dispatch", func(up *upstream) { *up = other }, "/p"}, |
| {"declared prefix", func(up *upstream) {}, "/assets/x"}, |
| {"undeclared build", func(up *upstream) { up.route.Version = "v9" }, "/p"}, |
| {"no build", func(up *upstream) { up.route.Version = "" }, "/p"}, |