mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 03:48:37 +08:00
Rename rocksmq unittests (#7846)
Signed-off-by: fishpenguin <kun.yu@zilliz.com>
This commit is contained in:
parent
00a5c39c2f
commit
f1366b9451
@ -41,7 +41,7 @@ func InitIDAllocator(kvPath string) *allocator.GlobalIDAllocator {
|
||||
return idAllocator
|
||||
}
|
||||
|
||||
func TestFixChannelName(t *testing.T) {
|
||||
func Test_FixChannelName(t *testing.T) {
|
||||
name := "abcd"
|
||||
fixName, err := fixChannelName(name)
|
||||
assert.Nil(t, err)
|
||||
@ -57,7 +57,7 @@ func etcdEndpoints() []string {
|
||||
return etcdEndpoints
|
||||
}
|
||||
|
||||
func TestInitRmq(t *testing.T) {
|
||||
func Test_InitRmq(t *testing.T) {
|
||||
name := "/tmp/rmq_init"
|
||||
endpoints := os.Getenv("ETCD_ENDPOINTS")
|
||||
if endpoints == "" {
|
||||
@ -77,7 +77,7 @@ func TestInitRmq(t *testing.T) {
|
||||
defer CloseRocksMQ()
|
||||
}
|
||||
|
||||
func TestGlobalRmq(t *testing.T) {
|
||||
func Test_InitRocksMQ(t *testing.T) {
|
||||
// Params.Init()
|
||||
rmqPath := "/tmp/milvus/rdb_data_global"
|
||||
os.Setenv("ROCKSMQ_PATH", rmqPath)
|
||||
@ -88,7 +88,7 @@ func TestGlobalRmq(t *testing.T) {
|
||||
defer CloseRocksMQ()
|
||||
}
|
||||
|
||||
func TestRegisterConsumer(t *testing.T) {
|
||||
func TestRocksmq_RegisterConsumer(t *testing.T) {
|
||||
kvPath := rmqPath + "_kv_register"
|
||||
defer os.RemoveAll(kvPath)
|
||||
idAllocator := InitIDAllocator(kvPath)
|
||||
@ -150,7 +150,7 @@ func TestRegisterConsumer(t *testing.T) {
|
||||
assert.Error(t, err)
|
||||
}
|
||||
|
||||
func TestRocksMQ(t *testing.T) {
|
||||
func TestRocksmq(t *testing.T) {
|
||||
kvPath := rmqPath + "_kv_rmq"
|
||||
defer os.RemoveAll(kvPath)
|
||||
idAllocator := InitIDAllocator(kvPath)
|
||||
@ -203,7 +203,7 @@ func TestRocksMQ(t *testing.T) {
|
||||
assert.Equal(t, string(cMsgs[1].Payload), "c_message")
|
||||
}
|
||||
|
||||
func TestRocksMQDummy(t *testing.T) {
|
||||
func TestRocksmq_Dummy(t *testing.T) {
|
||||
kvPath := rmqPath + "_kv_dummy"
|
||||
defer os.RemoveAll(kvPath)
|
||||
idAllocator := InitIDAllocator(kvPath)
|
||||
@ -253,7 +253,7 @@ func TestRocksMQDummy(t *testing.T) {
|
||||
pMsgs[0] = pMsgA
|
||||
}
|
||||
|
||||
func TestRocksMQ_Loop(t *testing.T) {
|
||||
func TestRocksmq_Loop(t *testing.T) {
|
||||
ep := etcdEndpoints()
|
||||
etcdKV, err := etcdkv.NewEtcdKV(ep, "/etcd/test/root")
|
||||
assert.Nil(t, err)
|
||||
@ -321,7 +321,7 @@ func TestRocksMQ_Loop(t *testing.T) {
|
||||
assert.Equal(t, len(cMsgs), 0)
|
||||
}
|
||||
|
||||
func TestRocksMQ_Goroutines(t *testing.T) {
|
||||
func TestRocksmq_Goroutines(t *testing.T) {
|
||||
ep := etcdEndpoints()
|
||||
etcdKV, err := etcdkv.NewEtcdKV(ep, "/etcd/test/root")
|
||||
assert.Nil(t, err)
|
||||
@ -392,7 +392,7 @@ func TestRocksMQ_Goroutines(t *testing.T) {
|
||||
Produce: 190000 message / s
|
||||
Consume: 90000 message / s
|
||||
*/
|
||||
func TestRocksMQ_Throughout(t *testing.T) {
|
||||
func TestRocksmq_Throughout(t *testing.T) {
|
||||
ep := etcdEndpoints()
|
||||
etcdKV, err := etcdkv.NewEtcdKV(ep, "/etcd/test/root")
|
||||
assert.Nil(t, err)
|
||||
@ -446,7 +446,7 @@ func TestRocksMQ_Throughout(t *testing.T) {
|
||||
log.Printf("Total consume %d item, cost %v ms, throughout %v / s", entityNum, cDuration, int64(entityNum)*1000/cDuration)
|
||||
}
|
||||
|
||||
func TestRocksMQ_MultiChan(t *testing.T) {
|
||||
func TestRocksmq_MultiChan(t *testing.T) {
|
||||
ep := etcdEndpoints()
|
||||
etcdKV, err := etcdkv.NewEtcdKV(ep, "/etcd/test/root")
|
||||
assert.Nil(t, err)
|
||||
@ -495,7 +495,7 @@ func TestRocksMQ_MultiChan(t *testing.T) {
|
||||
assert.Equal(t, string(cMsgs[0].Payload), "for_chann1_"+strconv.Itoa(0))
|
||||
}
|
||||
|
||||
func TestRocksMQ_CopyData(t *testing.T) {
|
||||
func TestRocksmq_CopyData(t *testing.T) {
|
||||
ep := etcdEndpoints()
|
||||
etcdKV, err := etcdkv.NewEtcdKV(ep, "/etcd/test/root")
|
||||
assert.Nil(t, err)
|
||||
|
@ -87,7 +87,7 @@ func TestRmqRetention(t *testing.T) {
|
||||
assert.Equal(t, len(newRes), 0)
|
||||
}
|
||||
|
||||
func TestLoadRetentionInfo(t *testing.T) {
|
||||
func TestRetentionInfo_LoadRetentionInfo(t *testing.T) {
|
||||
atomic.StoreInt64(&RocksmqRetentionTimeInMinutes, 0)
|
||||
atomic.StoreInt64(&RocksmqRetentionSizeInMB, 0)
|
||||
atomic.StoreInt64(&RocksmqPageSize, 100)
|
||||
@ -164,7 +164,7 @@ func TestLoadRetentionInfo(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestComplexRmqRetention(t *testing.T) {
|
||||
func TestRmqRetention_Complex(t *testing.T) {
|
||||
atomic.StoreInt64(&RocksmqRetentionSizeInMB, 0)
|
||||
atomic.StoreInt64(&RocksmqRetentionTimeInMinutes, 1)
|
||||
atomic.StoreInt64(&RocksmqPageSize, 10)
|
||||
@ -228,7 +228,7 @@ func TestComplexRmqRetention(t *testing.T) {
|
||||
// assert.NotEqual(t, newRes[0].MsgID, cMsgs[11].MsgID)
|
||||
}
|
||||
|
||||
func TestRmqRetentionPageTimeExpire(t *testing.T) {
|
||||
func TestRmqRetention_PageTimeExpire(t *testing.T) {
|
||||
atomic.StoreInt64(&RocksmqRetentionSizeInMB, 0)
|
||||
atomic.StoreInt64(&RocksmqRetentionTimeInMinutes, 0)
|
||||
atomic.StoreInt64(&RocksmqPageSize, 10)
|
||||
|
Loading…
Reference in New Issue
Block a user