From f1366b9451ae5e9c7883812101bd3a0908e92772 Mon Sep 17 00:00:00 2001 From: yukun Date: Tue, 14 Sep 2021 09:55:00 +0800 Subject: [PATCH] Rename rocksmq unittests (#7846) Signed-off-by: fishpenguin --- .../server/rocksmq/rocksmq_impl_test.go | 22 +++++++++---------- .../server/rocksmq/rocksmq_retention_test.go | 6 ++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/internal/util/rocksmq/server/rocksmq/rocksmq_impl_test.go b/internal/util/rocksmq/server/rocksmq/rocksmq_impl_test.go index b5ea574047..83072d4369 100644 --- a/internal/util/rocksmq/server/rocksmq/rocksmq_impl_test.go +++ b/internal/util/rocksmq/server/rocksmq/rocksmq_impl_test.go @@ -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) diff --git a/internal/util/rocksmq/server/rocksmq/rocksmq_retention_test.go b/internal/util/rocksmq/server/rocksmq/rocksmq_retention_test.go index 4db1f2d141..07fc36d9e6 100644 --- a/internal/util/rocksmq/server/rocksmq/rocksmq_retention_test.go +++ b/internal/util/rocksmq/server/rocksmq/rocksmq_retention_test.go @@ -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)