frostfs-node/pkg/morph/client/multy_test.go
Evgenii Stratonikov d641cba2fc [#587] Do not use math/rand.Read
Fix staticcheck warnings after go1.20 update.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-09 16:02:44 +03:00

29 lines
477 B
Go

package client
import (
"math/rand"
"testing"
"time"
"github.com/stretchr/testify/require"
)
func TestInitEndpoints(t *testing.T) {
r := rand.New(rand.NewSource(time.Now().UnixNano()))
ee := make([]Endpoint, 100)
for i := range ee {
ee[i].Priority = r.Int()
}
var eeInternal endpoints
eeInternal.init(ee)
prevValue := eeInternal.list[0].Priority
for _, e := range eeInternal.list {
require.True(t, prevValue <= e.Priority)
prevValue = e.Priority
}
}