satellite/accounting: Billing tests wait for SNs

The billing tests were flaky because some assertions ran before the
storage nodes finish their work.

A new helper function in testplanet has been added to allow to wait for
storage nodes endpoints to finish their work. This function now it's
used in the billing tests for avoiding their flakiness.

This commit closes the ticket:
https://storjlabs.atlassian.net/browse/SM-403

A part of fixing other billing tests flakiness.

Change-Id: Iacb750af435f515c04b1e1d3510a218d184c9abc
This commit is contained in:
Ivan Fraixedes 2020-03-05 12:34:12 +01:00
parent f4d5d89b68
commit e6d452decd
No known key found for this signature in database
GPG Key ID: 042B474597F96DB7

View File

@ -61,8 +61,6 @@ func TestBilling_DownloadAndNoUploadTraffic(t *testing.T) {
Satellite: testplanet.ReconfigureRS(2, 3, 4, 4),
},
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
t.Skip("test sometimes fails in the last assertion")
const (
bucketName = "a-bucket"
objectKey = "object-filename"
@ -109,6 +107,9 @@ func getTotalProjectBandwidth(
) int64 {
t.Helper()
// Wait for the SNs endpoints to finish thir work
require.NoError(t, planet.WaitForStorageNodeEndpoints(ctx))
// Calculate the bandwidth used for upload
for _, sn := range planet.StorageNodes {
sn.Storage2.Orders.Sender.TriggerWait()