fix(api): report a page as degraded unless every component is down
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
4d1db0943e
commit
e6c3deb54d
2 files changed
+13
-4
No files matched your search
@@ -91,8 +91,9 @@ func TestStatusPages(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("Page() failed: %v", err)
|
||||
}
|
||||
if snap.Status != agentapi.PageOutage || len(snap.Sections) != 2 || snap.Sections[1].Components[0].Name != "Public API" {
|
||||
t.Errorf("snapshot = %+v, want outage with Frontend and Backend sections", snap)
|
||||
if snap.Status != agentapi.PageDegraded || len(snap.Sections) != 2 || snap.Sections[1].Components[0].Status != agentapi.PageOutage ||
|
||||
snap.Sections[1].Components[0].Name != "Public API" {
|
||||
t.Errorf("snapshot = %+v, want degraded page with the Public API in outage", snap)
|
||||
}
|
||||
raw, _ := json.Marshal(snap)
|
||||
for _, secret := range []string{up.URL, down.URL, "unexpected status"} {
|
||||
|
||||
Reference in new issue
Block a user