From 13ca2d96b23d8a4f8d8f251669e2a135e32e6ea3 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Sun, 26 Jul 2026 17:41:03 +0200 Subject: [PATCH] fix(test): give the tiered-server harness a real storage view (v0.102.0 follow-up) v0.102.0 defers a tier whose target storage is absent. The Slice A harness used fakeStorage{} with NO targets, so after that change it deferred every tier and five Slice A assertions became vacuous failures. The product behaviour is correct; the harness never modelled a real box, which has both storages present. Fixed by giving it local + felhom-pbs. My error, and worth naming: I ran the suite and committed in the same command, read 'packages ok: 28' and pushed without checking rc=1. That is exactly the exit-code trap recorded in this arc twice already. Full agent suite green: rc=0, 29 packages. --- internal/localapi/backup_tiers_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/localapi/backup_tiers_test.go b/internal/localapi/backup_tiers_test.go index 42db8df..3815acc 100644 --- a/internal/localapi/backup_tiers_test.go +++ b/internal/localapi/backup_tiers_test.go @@ -27,9 +27,15 @@ func tieredServer(t *testing.T, st *fakeStore, localSvc, pbsSvc *fakeBackups) *S ListenAddr: "127.0.0.1:0", Guests: &fakeGuests{}, Backups: localSvc, - Store: st, - Storage: fakeStorage{}, - Tokens: staticTokens{"A": 8200, "B": 9300}, + Store: st, + // Both tier targets must be PRESENT in the storage view: since v0.102.0 a tier whose target + // storage is absent DEFERS. A real box has both; a fake with no targets would silently + // defer every tier and make these assertions vacuous. + Storage: fakeStorage{targets: []hub.StorageTarget{ + {Name: "local", Type: "local"}, + {Name: "felhom-pbs", Type: "pbs"}, + }}, + Tokens: staticTokens{"A": 8200, "B": 9300}, BackupTiers: []BackupTier{ {TargetID: "local", Cadence: 24 * time.Hour, Primary: true, Service: localSvc}, {TargetID: "felhom-pbs", Cadence: 7 * 24 * time.Hour, Service: pbsSvc},