Skip to content

Commit

Permalink
satellite/orders: Update some tests to use assert instead of require
Browse files Browse the repository at this point in the history
These two tests are flaky in Jenkins. By changing a few `require`s to
`assert`s, we can get more information in the Jenkins output that may
help debug why the tests are flaky.

Change-Id: Ic17a012c456212a852b093ecf1c9ccd512df0ba9
  • Loading branch information
mobyvb authored and Storj Robot committed Dec 11, 2023
1 parent 56883c6 commit ee3ae26
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions satellite/orders/orders_test.go
Expand Up @@ -7,6 +7,7 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"storj.io/common/memory"
Expand Down Expand Up @@ -189,12 +190,12 @@ func TestUploadDownloadBandwidth(t *testing.T) {

bucketBandwidth, err := ordersDB.GetBucketBandwidth(ctx, planet.Uplinks[0].Projects[0].ID, []byte(bucketName), beforeRollup, afterRollup)
require.NoError(t, err)
require.Equal(t, expectedBucketBandwidth, bucketBandwidth)
assert.Equal(t, expectedBucketBandwidth, bucketBandwidth)

for _, storageNode := range planet.StorageNodes {
nodeBandwidth, err := ordersDB.GetStorageNodeBandwidth(ctx, storageNode.ID(), beforeRollup, afterRollup)
require.NoError(t, err)
require.Equal(t, expectedStorageBandwidth[storageNode.ID()], nodeBandwidth)
assert.NoError(t, err)
assert.Equal(t, expectedStorageBandwidth[storageNode.ID()], nodeBandwidth)
}
})
}
Expand Down Expand Up @@ -395,8 +396,8 @@ func TestProjectBandwidthDailyRollups(t *testing.T) {
year, month, day := now.Year(), now.Month(), now.Day()
allocated, settled, dead, err := projectAccountingDB.GetProjectDailyBandwidth(ctx, planet.Uplinks[0].Projects[0].ID, year, month, day)
require.NoError(t, err)
require.NotZero(t, allocated)
require.Equal(t, allocated, settled)
require.Zero(t, dead)
assert.NotZero(t, allocated)
assert.Equal(t, allocated, settled)
assert.Zero(t, dead)
})
}

0 comments on commit ee3ae26

Please sign in to comment.