controller: fix-3 dead-app alerting + fix-6 ring cap/spill/spam (WIP, pre-build)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017CDMFpFx84pfviCTVuGGhf
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package stacks
|
||||
|
||||
import "testing"
|
||||
|
||||
// fix-3: only stopped/exited count as "down" for a deployed app. starting/unhealthy (running),
|
||||
// restarting/deploying (transient), paused (deliberate), unknown (ambiguous) must NOT alert.
|
||||
func TestIsDownState(t *testing.T) {
|
||||
down := []ContainerState{StateStopped, StateExited}
|
||||
for _, s := range down {
|
||||
if !IsDownState(s) {
|
||||
t.Errorf("IsDownState(%q) = false, want true", s)
|
||||
}
|
||||
}
|
||||
notDown := []ContainerState{
|
||||
StateRunning, StateStarting, StateUnhealthy, StateRestarting,
|
||||
StateDeploying, StatePaused, StateUnknown, StateNotDeployed, StateOrphaned,
|
||||
}
|
||||
for _, s := range notDown {
|
||||
if IsDownState(s) {
|
||||
t.Errorf("IsDownState(%q) = true, want false (must not manufacture a dead-app alert)", s)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user