From c24f1920d999c8871d6bbda72cb8b4178271b789 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Fri, 14 Aug 2026 08:12:44 +0200 Subject: [PATCH] test(disk-health): Group L must run TWO checks after the restart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- controller/internal/web/disk_health_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/controller/internal/web/disk_health_test.go b/controller/internal/web/disk_health_test.go index b8ce014..16e7c4d 100644 --- a/controller/internal/web/disk_health_test.go +++ b/controller/internal/web/disk_health_test.go @@ -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) }