From 14f49558ac1490a5a0d439105cc4f1546b3ee10f Mon Sep 17 00:00:00 2001 From: Michal Niewrzal Date: Wed, 29 Jul 2020 14:17:11 +0200 Subject: [PATCH] satellite/admin: fix test failing at the end of month Change-Id: I6db6080614eaa0d775c730a7eec571b02da03e7f --- satellite/admin/project_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/satellite/admin/project_test.go b/satellite/admin/project_test.go index cf2fa029a..b3cecf064 100644 --- a/satellite/admin/project_test.go +++ b/satellite/admin/project_test.go @@ -349,7 +349,9 @@ func TestDeleteProjectWithUsagePreviousMonth(t *testing.T) { require.NoError(t, err) //ToDo: Improve updating of DB entries - accTime := time.Now().UTC().AddDate(0, -1, 0) + now := time.Now().UTC() + // set fixed day to avoid failures at the end of the month + accTime := time.Date(now.Year(), now.Month()-1, 15, now.Hour(), now.Minute(), now.Second(), now.Nanosecond(), time.UTC) tally := accounting.BucketStorageTally{ BucketName: "test", ProjectID: projectID,