frostfs-node/pkg/morph/client/multy_test.go

30 lines
477 B
Go
Raw Permalink Normal View History

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
}
}