R-772 (found live on 9202 with v0.286.0): a stopped probe container is seen on the next tick, not when the last healthy record's 5-minute interval runs out

Finding the container costs no network call, so it now runs before the interval check. Red-proof RP-D1b.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
2026-10-01 21:11:22 +02:00
parent d4167420d1
commit 79ef715277
2 changed files with 25 additions and 10 deletions
@@ -78,3 +78,16 @@ func TestProbeSaysUnhealthy_NotCheckedLeavesTheStateAlone(t *testing.T) {
t.Fatal("nil / healthy must not override")
}
}
// Measured live on 9202 (v0.286.0): with a HEALTHY record 2 minutes old, stopping the probe's container left the record
// "healthy" until its 5-minute interval ran out. The missing container is now seen on the very next tick.
func TestRunHealthProbes_AStoppedContainerIsSeenAtOnce(t *testing.T) {
m := r772Manager(time.Now())
st := r772Stack()
st.HealthProbe = &HealthProbeResult{Healthy: true, LastCheck: time.Now().Add(-2 * time.Minute)}
m.stacks["karakeep"] = st
_ = m.RunHealthProbes()
if hp := m.stacks["karakeep"].HealthProbe; hp.Healthy || !hp.NotChecked {
t.Fatalf("a stopped probe container must be recorded not checked on the next tick, got %+v", hp)
}
}