private/testplanet: Mark sn peer deleter test mode

When running testplanet tests, mark storagenode peer PieceDeleter as in
testing mode so that you don't have to do it on each test.

Change-Id: I2592e02c63f8bcc9152ecf436bac4e798b08bccf
This commit is contained in:
Isaac Hess 2020-04-28 15:57:29 -06:00
parent c5309a3f91
commit baccfd36b1
3 changed files with 3 additions and 20 deletions

View File

@ -215,6 +215,9 @@ func (planet *Planet) newStorageNodes(count int, whitelistedSatellites storj.Nod
return xs, err
}
// Mark the peer's PieceDeleter as in testing mode, so it is easy to wait on the deleter
peer.Storage2.PieceDeleter.SetupTest()
err = db.CreateTables(context.TODO())
if err != nil {
return nil, err

View File

@ -59,10 +59,6 @@ func TestEndpoint_DeleteObjectPieces(t *testing.T) {
percentExp = 0.75
)
for _, sn := range planet.StorageNodes {
sn.Peer.Storage2.PieceDeleter.SetupTest()
}
err := uplnk.UploadWithClientConfig(ctx, satelliteSys, testplanet.UplinkConfig{
Client: testplanet.ClientConfig{
SegmentSize: 10 * memory.KiB,
@ -144,10 +140,6 @@ func TestEndpoint_DeleteObjectPieces(t *testing.T) {
satelliteSys = planet.Satellites[0]
)
for _, sn := range planet.StorageNodes {
sn.Peer.Storage2.PieceDeleter.SetupTest()
}
err := uplnk.UploadWithClientConfig(ctx, satelliteSys, testplanet.UplinkConfig{
Client: testplanet.ClientConfig{
SegmentSize: 10 * memory.KiB,

View File

@ -89,10 +89,6 @@ func TestService_DeletePieces_AllNodesUp(t *testing.T) {
percentExp := 0.75
for _, sn := range planet.StorageNodes {
sn.Peer.Storage2.PieceDeleter.SetupTest()
}
{
data := testrand.Bytes(10 * memory.KiB)
err := uplnk.UploadWithClientConfig(ctx, satelliteSys, testplanet.UplinkConfig{
@ -172,10 +168,6 @@ func TestService_DeletePieces_SomeNodesDown(t *testing.T) {
satelliteSys := planet.Satellites[0]
numToShutdown := 2
for _, sn := range planet.StorageNodes {
sn.Peer.Storage2.PieceDeleter.SetupTest()
}
{
data := testrand.Bytes(10 * memory.KiB)
err := uplnk.UploadWithClientConfig(ctx, satelliteSys, testplanet.UplinkConfig{
@ -247,10 +239,6 @@ func TestService_DeletePieces_AllNodesDown(t *testing.T) {
uplnk := planet.Uplinks[0]
satelliteSys := planet.Satellites[0]
for _, sn := range planet.StorageNodes {
sn.Peer.Storage2.PieceDeleter.SetupTest()
}
{
data := testrand.Bytes(10 * memory.KiB)
err := uplnk.UploadWithClientConfig(ctx, satelliteSys, testplanet.UplinkConfig{