Fix randomness in stopping nodes in TestGetObjectStream (#1277)

This commit is contained in:
Kaloyan Raev 2019-02-08 15:20:12 +02:00 committed by GitHub
parent c7ad427d95
commit 4e738bbd44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,7 +152,7 @@ func TestGetObjectStream(t *testing.T) {
// Stop randomly half of the storage nodes and remove them from satellite's overlay cache
perm := mathrand.Perm(len(planet.StorageNodes))
for i := 0; i < len(perm)/2; i++ {
for _, i := range perm[:(len(perm) / 2)] {
assert.NoError(t, planet.StopPeer(planet.StorageNodes[i]))
assert.NoError(t, planet.Satellites[0].Overlay.Service.Delete(ctx, planet.StorageNodes[i].ID()))
}