Skip to content

Commit

Permalink
satellite/accounting/nodetally: fix overflow in test
Browse files Browse the repository at this point in the history
Change-Id: I1f7ed7ff9f6e8cb1ec01da596080e6e27e383cc0
  • Loading branch information
egonelbre committed Feb 7, 2024
1 parent 1d84193 commit 9f8ce33
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions satellite/accounting/nodetally/observer_test.go
Expand Up @@ -130,11 +130,11 @@ func TestManyObjectsNodeTallyRangedLoop(t *testing.T) {
},
},
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
timespanHours := 2
const timespanHours = 2
numObjects := 10

now := time.Date(2020, 8, 8, 8, 8, 8, 0, time.UTC)
lastTally := now.Add(time.Duration(-1 * timespanHours * int(time.Hour)))
lastTally := now.Add(-timespanHours * time.Hour)
// Set previous accounting run timestamp
err := planet.Satellites[0].DB.StoragenodeAccounting().DeleteTalliesBefore(ctx, now.Add(1*time.Second), 5000)
require.NoError(t, err)
Expand Down Expand Up @@ -208,7 +208,7 @@ func TestExpiredObjectsNotCountedInNodeTally(t *testing.T) {
},
},
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
timespanHours := 2
const timespanHours = 2
numObjects := 10

now := time.Date(2030, 8, 8, 8, 8, 8, 0, time.UTC)
Expand All @@ -217,7 +217,7 @@ func TestExpiredObjectsNotCountedInNodeTally(t *testing.T) {
return now
})

lastTally := now.Add(time.Duration(-1 * timespanHours * int(time.Hour)))
lastTally := now.Add(-timespanHours * time.Hour)
err := planet.Satellites[0].DB.StoragenodeAccounting().SaveTallies(ctx, lastTally,
[]storj.NodeID{planet.StorageNodes[0].ID(), planet.StorageNodes[1].ID(), planet.StorageNodes[2].ID(), planet.StorageNodes[3].ID()},
[]float64{0, 0, 0, 0},
Expand Down

0 comments on commit 9f8ce33

Please sign in to comment.