test(disk-health): Group L must run TWO checks after the restart

One check cannot distinguish a loaded state from a silent re-baseline — a
forgetful controller is also silent on its first check. It betrays itself on
the second, when the rebuilt prior makes the disk look newly sustained and it
alerts all over again. Caught while building the companion red-proof: with the
state load skipped, the single-check version still passed.
This commit is contained in:
2026-08-14 08:12:44 +02:00
parent bb50e1293c
commit c24f1920d9
@@ -498,8 +498,13 @@ func TestDiskCheck_StateSurvivesRestart_ProductionPath(t *testing.T) {
}
// Restart: a brand-new Server over the same data dir, disk still failing.
//
// TWO checks, deliberately. One is not enough to tell a loaded state from a silent re-baseline:
// a forgetful controller is also silent on its first check. It betrays itself on the SECOND,
// when the rebuilt prior makes the disk look newly sustained and it alerts all over again.
s2, fired2 := newProdServer()
_ = s2.RunDiskHealthCheck(context.Background())
_ = s2.RunDiskHealthCheck(context.Background())
if n := len(*fired2); n != 0 {
t.Errorf("a restarted controller must NOT re-alert an already-reported disk, got %d: %+v", n, *fired2)
}