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.
This commit is contained in:
@@ -27,9 +27,15 @@ func tieredServer(t *testing.T, st *fakeStore, localSvc, pbsSvc *fakeBackups) *S
|
|||||||
ListenAddr: "127.0.0.1:0",
|
ListenAddr: "127.0.0.1:0",
|
||||||
Guests: &fakeGuests{},
|
Guests: &fakeGuests{},
|
||||||
Backups: localSvc,
|
Backups: localSvc,
|
||||||
Store: st,
|
Store: st,
|
||||||
Storage: fakeStorage{},
|
// Both tier targets must be PRESENT in the storage view: since v0.102.0 a tier whose target
|
||||||
Tokens: staticTokens{"A": 8200, "B": 9300},
|
// 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{
|
BackupTiers: []BackupTier{
|
||||||
{TargetID: "local", Cadence: 24 * time.Hour, Primary: true, Service: localSvc},
|
{TargetID: "local", Cadence: 24 * time.Hour, Primary: true, Service: localSvc},
|
||||||
{TargetID: "felhom-pbs", Cadence: 7 * 24 * time.Hour, Service: pbsSvc},
|
{TargetID: "felhom-pbs", Cadence: 7 * 24 * time.Hour, Service: pbsSvc},
|
||||||
|
|||||||
Reference in New Issue
Block a user