From 2463b881c6f2e187ad601d2459fb961f3124b94b Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Thu, 29 Jun 2023 20:52:04 +0300 Subject: [PATCH] storagenode/piecestore: fix TestUpload The test needs to wait for the upload information to be saved to the database. Fixes https://github.com/storj/storj/issues/6008 Change-Id: I1f258c923a4b33cbc571f97bad046cec70642a0b --- storagenode/piecestore/endpoint_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storagenode/piecestore/endpoint_test.go b/storagenode/piecestore/endpoint_test.go index e7f1fe6c8..18369d3ba 100644 --- a/storagenode/piecestore/endpoint_test.go +++ b/storagenode/piecestore/endpoint_test.go @@ -72,6 +72,8 @@ func TestUploadAndPartialDownload(t *testing.T) { }() } + require.NoError(t, planet.WaitForStorageNodeEndpoints(ctx)) + var totalBandwidthUsage bandwidth.Usage for _, storagenode := range planet.StorageNodes { usage, err := storagenode.DB.Bandwidth().Summary(ctx, time.Now().Add(-10*time.Hour), time.Now().Add(10*time.Hour)) @@ -191,6 +193,8 @@ func TestUpload(t *testing.T) { } } + require.NoError(t, planet.WaitForStorageNodeEndpoints(ctx)) + from, to := date.MonthBoundary(time.Now().UTC()) summary, err := planet.StorageNodes[0].DB.Bandwidth().SatelliteIngressSummary(ctx, planet.Satellites[0].ID(), from, to) require.NoError(t, err)