gofmt: normalize internal/localapi (whitespace only)
Swept up by gofmt -w on the package while adding the guest-power observable. No semantic change; 3 of 5 files are tests.
This commit is contained in:
@@ -28,7 +28,7 @@ func tieredServer(t *testing.T, st *fakeStore, localSvc, pbsSvc *fakeBackups) *S
|
||||
ListenAddr: "127.0.0.1:0",
|
||||
Guests: &fakeGuests{},
|
||||
Backups: localSvc,
|
||||
Store: st,
|
||||
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.
|
||||
@@ -260,7 +260,7 @@ func TestBackupTiers_AdvertisesPrimaryFirst(t *testing.T) {
|
||||
if !resp.Data.Tiers[0].Primary || resp.Data.Tiers[0].Target != "local" {
|
||||
t.Fatalf("primary must be first and flagged; got %+v", resp.Data.Tiers)
|
||||
}
|
||||
if resp.Data.Tiers[1].Target != "felhom-pbs" || resp.Data.Tiers[1].CadenceSeconds != int64((7 * 24 * time.Hour).Seconds()) {
|
||||
if resp.Data.Tiers[1].Target != "felhom-pbs" || resp.Data.Tiers[1].CadenceSeconds != int64((7*24*time.Hour).Seconds()) {
|
||||
t.Fatalf("PBS tier mis-advertised: %+v", resp.Data.Tiers[1])
|
||||
}
|
||||
}
|
||||
@@ -601,7 +601,8 @@ func dueFor(t *testing.T, h http.Handler, target string) BackupDueResponse {
|
||||
// COMPANION RED-PROOF (observed): delete the newestArchiveOn fold-in from handleBackupDue (the
|
||||
// pre-R-84 shape, in-memory only) → this fails with
|
||||
// "a restart must NOT make the tier due when the storage holds a 2h-old backup;
|
||||
// got {... Due:true Reason:no successful backup recorded yet ...}". Restored.
|
||||
//
|
||||
// got {... Due:true Reason:no successful backup recorded yet ...}". Restored.
|
||||
func TestBackupDue_ColdStore_UsesStorageGroundTruth(t *testing.T) {
|
||||
h := listerServer(t, &fakeStore{}, archiveLister{
|
||||
fakeBackups: &fakeBackups{}, at: testNow.Add(-2 * time.Hour), found: true,
|
||||
@@ -610,7 +611,7 @@ func TestBackupDue_ColdStore_UsesStorageGroundTruth(t *testing.T) {
|
||||
if got.Due {
|
||||
t.Fatalf("a restart must NOT make the tier due when the storage holds a 2h-old backup; got %+v", got)
|
||||
}
|
||||
if got.AgeSecs == nil || *got.AgeSecs != int64((2 * time.Hour).Seconds()) {
|
||||
if got.AgeSecs == nil || *got.AgeSecs != int64((2*time.Hour).Seconds()) {
|
||||
t.Fatalf("the age must come from the storage; got %+v", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user