storagenode/piecestore: add wait to test

Change-Id: I05efeffe2845f6b816bf44e50b79c115a86d4b60
This commit is contained in:
Isaac Hess 2020-04-29 12:38:05 -06:00
parent e26a5598ec
commit 4f492a1ca9

View File

@ -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)