Skip to content

Commit c2c2c9a

Browse files
committed
Test backup creation timestamp in UTC
1 parent c2489d8 commit c2c2c9a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

upcloud/service/service_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,11 @@ func TestCreateBackup(t *testing.T) {
409409

410410
// Create a backup
411411
t.Logf("Creating backup of storage with UUID %s ...", storageDetails.UUID)
412-
timeBeforeBackup := time.Now()
412+
413+
utc, err := time.LoadLocation("UTC")
414+
handleError(err)
415+
416+
timeBeforeBackup := time.Now().In(utc)
413417

414418
backupDetails, err := svc.CreateBackup(&request.CreateBackupRequest{
415419
UUID: storageDetails.UUID,
@@ -418,7 +422,9 @@ func TestCreateBackup(t *testing.T) {
418422

419423
handleError(err)
420424
waitForStorageOnline(storageDetails.UUID)
421-
timeAfterBackup := time.Now()
425+
426+
timeAfterBackup := time.Now().In(utc)
427+
422428
t.Logf("Created backup with UUID %s", backupDetails.UUID)
423429

424430
// Get backup storage details

0 commit comments

Comments
 (0)