From 4f492a1ca9bdd8354d6d1890ef89ba8835ef8b89 Mon Sep 17 00:00:00 2001 From: Isaac Hess Date: Wed, 29 Apr 2020 12:38:05 -0600 Subject: [PATCH] storagenode/piecestore: add wait to test Change-Id: I05efeffe2845f6b816bf44e50b79c115a86d4b60 --- storagenode/piecestore/endpoint_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/storagenode/piecestore/endpoint_test.go b/storagenode/piecestore/endpoint_test.go index 61f736fc9..01b3e5e6b 100644 --- a/storagenode/piecestore/endpoint_test.go +++ b/storagenode/piecestore/endpoint_test.go @@ -387,6 +387,8 @@ func TestDeletePieces(t *testing.T) { }) require.NoError(t, err) + planet.WaitForStorageNodeDeleters(ctx) + for i, pieceID := range pieceIDs { _, err = downloadPiece(t, ctx, pieceID, int64(len(dataArray[i])), storagenode, planet.Uplinks[0], satellite) require.Error(t, err) @@ -410,6 +412,8 @@ func TestDeletePieces(t *testing.T) { }) require.NoError(t, err) + planet.WaitForStorageNodeDeleters(ctx) + for i, pieceID := range pieceIDs { _, err = downloadPiece(t, ctx, pieceID, int64(len(dataArray[i])), storagenode, planet.Uplinks[0], satellite) require.Error(t, err) @@ -427,6 +431,8 @@ func TestDeletePieces(t *testing.T) { _, err := client.DeletePieces(ctx.Context, &pb.DeletePiecesRequest{}) require.NoError(t, err) + planet.WaitForStorageNodeDeleters(ctx) + downloaded, err := downloadPiece(t, ctx, pieceID, int64(len(data)), storagenode, planet.Uplinks[0], satellite) require.NoError(t, err) require.Equal(t, data, downloaded) @@ -447,6 +453,8 @@ func TestDeletePieces(t *testing.T) { require.Error(t, err) require.Equal(t, rpcstatus.PermissionDenied, rpcstatus.Code(err)) + planet.WaitForStorageNodeDeleters(ctx) + downloaded, err := downloadPiece(t, ctx, pieceID, int64(len(data)), storagenode, planet.Uplinks[0], satellite) require.NoError(t, err) require.Equal(t, data, downloaded)