mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 10:08:42 +08:00
Remove etcd dependency for querycoord unit test (#26550)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
e11f84ff45
commit
9364d0ea49
@ -18,6 +18,9 @@ package querycoordv2
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"math/rand"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -46,6 +49,24 @@ import (
|
|||||||
"github.com/milvus-io/milvus/pkg/util/paramtable"
|
"github.com/milvus-io/milvus/pkg/util/paramtable"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
// init embed etcd
|
||||||
|
embedetcdServer, tempDir, err := etcd.StartTestEmbedEtcdServer()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err.Error())
|
||||||
|
}
|
||||||
|
defer os.RemoveAll(tempDir)
|
||||||
|
defer embedetcdServer.Close()
|
||||||
|
|
||||||
|
addrs := etcd.GetEmbedEtcdEndpoints(embedetcdServer)
|
||||||
|
|
||||||
|
paramtable.Init()
|
||||||
|
paramtable.Get().Save(Params.EtcdCfg.Endpoints.Key, strings.Join(addrs, ","))
|
||||||
|
|
||||||
|
rand.Seed(time.Now().UnixNano())
|
||||||
|
os.Exit(m.Run())
|
||||||
|
}
|
||||||
|
|
||||||
type ServerSuite struct {
|
type ServerSuite struct {
|
||||||
suite.Suite
|
suite.Suite
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user