milvus/internal/writenode/write_node_test.go
bigsheeper 585d3f9831 Refactor param table, and add ddNode
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2020-12-11 17:20:14 +08:00

33 lines
648 B
Go

package writenode
import (
"fmt"
"math/rand"
"os"
"strconv"
"testing"
)
func makeNewChannelNames(names []string, suffix string) []string {
var ret []string
for _, name := range names {
ret = append(ret, name+suffix)
}
return ret
}
func refreshChannelNames() {
suffix := "-test-write-node" + strconv.FormatInt(rand.Int63n(100), 10)
Params.DDChannelNames = makeNewChannelNames(Params.DDChannelNames, suffix)
Params.InsertChannelNames = makeNewChannelNames(Params.InsertChannelNames, suffix)
}
func TestMain(m *testing.M) {
Params.Init()
refreshChannelNames()
p := Params
fmt.Println(p)
exitCode := m.Run()
os.Exit(exitCode)
}