498b235461
Build and test / Build and test AMD64 Ubuntu 22.04 (push) Failing after 0s
Publish Builder / amazonlinux2023 (push) Failing after 1s
Build and test / UT for Go (push) Has been skipped
Publish KRTE Images / KRTE (push) Failing after 1s
Build and test / Integration Test (push) Has been skipped
Build and test / Upload Code Coverage (push) Has been skipped
Publish Builder / rockylinux9 (push) Failing after 1s
Publish Builder / ubuntu22.04 (push) Failing after 0s
Publish Builder / ubuntu24.04 (push) Failing after 0s
Publish Gpu Builder / publish-gpu-builder (push) Failing after 1s
Publish Test Images / PyTest (push) Failing after 0s
Build and test / UT for Cpp (push) Has been cancelled
48 lines
1.2 KiB
Go
48 lines
1.2 KiB
Go
package server
|
|
|
|
import (
|
|
"context"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
etcdkv "github.com/milvus-io/milvus/internal/kv/etcd"
|
|
"github.com/milvus-io/milvus/internal/streamingcoord/server/balancer/channel"
|
|
"github.com/milvus-io/milvus/internal/types"
|
|
"github.com/milvus-io/milvus/internal/util/sessionutil"
|
|
"github.com/milvus-io/milvus/pkg/v3/util/etcd"
|
|
"github.com/milvus-io/milvus/pkg/v3/util/paramtable"
|
|
"github.com/milvus-io/milvus/pkg/v3/util/syncutil"
|
|
)
|
|
|
|
func TestServer(t *testing.T) {
|
|
paramtable.Init()
|
|
|
|
params := paramtable.Get()
|
|
|
|
channel.RecoverPChannelStatsManager([]string{})
|
|
|
|
endpoints := params.EtcdCfg.Endpoints.GetValue()
|
|
etcdEndpoints := strings.Split(endpoints, ",")
|
|
c, err := etcd.GetRemoteEtcdClient(etcdEndpoints)
|
|
assert.NoError(t, err)
|
|
assert.NotNil(t, c)
|
|
|
|
b := NewServerBuilder()
|
|
metaKV := etcdkv.NewEtcdKV(c, "test")
|
|
f := syncutil.NewFuture[types.MixCoordClient]()
|
|
s := sessionutil.NewMockSession(t)
|
|
s.EXPECT().GetRegisteredRevision().Return(int64(1))
|
|
newServer := b.WithETCD(c).
|
|
WithMetaKV(metaKV).
|
|
WithSession(s).
|
|
WithMixCoordClient(f).
|
|
Build()
|
|
|
|
ctx := context.Background()
|
|
err = newServer.Start(ctx, nil)
|
|
assert.NoError(t, err)
|
|
newServer.Stop()
|
|
}
|