diff --git a/blobstore/blobnode/db/metadb_bench_test.go b/blobstore/blobnode/db/metadb_bench_test.go index ac734cc83..9e2724496 100644 --- a/blobstore/blobnode/db/metadb_bench_test.go +++ b/blobstore/blobnode/db/metadb_bench_test.go @@ -29,7 +29,7 @@ import ( _ "github.com/cubefs/cubefs/blobstore/testing/nolog" ) -func BenchmarkKVDB_CoPut(b *testing.B) { +func BenchmarkRunCIKVDB_CoPut(b *testing.B) { testDir, err := os.MkdirTemp(os.TempDir(), "kvdbCoPut") require.NoError(b, err) defer os.RemoveAll(testDir) @@ -74,7 +74,7 @@ func BenchmarkKVDB_CoPut(b *testing.B) { require.NoError(b, err) } -func BenchmarkKVDB_DirectPut(b *testing.B) { +func BenchmarkRunCIKVDB_DirectPut(b *testing.B) { testDir, err := os.MkdirTemp(os.TempDir(), "kvdbBenchmarkPut") require.NoError(b, err) defer os.RemoveAll(testDir) @@ -119,7 +119,7 @@ func BenchmarkKVDB_DirectPut(b *testing.B) { require.NoError(b, err) } -func BenchmarkKVDB_CoDelete(b *testing.B) { +func BenchmarkRunCIKVDB_CoDelete(b *testing.B) { testDir, err := os.MkdirTemp(os.TempDir(), "kvdbCoDelete") require.NoError(b, err) defer os.RemoveAll(testDir) @@ -175,7 +175,7 @@ func BenchmarkKVDB_CoDelete(b *testing.B) { require.NoError(b, err) } -func BenchmarkKVDB_DirectDelete(b *testing.B) { +func BenchmarkRunCIKVDB_DirectDelete(b *testing.B) { testDir, err := os.MkdirTemp(os.TempDir(), "kvdbDelete") require.NoError(b, err) defer os.RemoveAll(testDir) diff --git a/blobstore/clustermgr/cluster/alloc_test.go b/blobstore/clustermgr/cluster/alloc_test.go index 040d0b74b..36958bc7c 100644 --- a/blobstore/clustermgr/cluster/alloc_test.go +++ b/blobstore/clustermgr/cluster/alloc_test.go @@ -1084,8 +1084,8 @@ func BenchmarkAllocFromDiskStoragesParallel(b *testing.B) { testDiskMgr.cfg.HeartbeatExpireIntervalS = 6000 _, ctx := trace.StartSpanFromContext(context.Background(), "benchmark-parallel") - initTestBlobNodeMgrNodes(&testing.T{}, testDiskMgr, 1, 20, testIdcs[0]) - initTestBlobNodeMgrDisks(&testing.T{}, testDiskMgr, 1, 1200, true, testIdcs[0]) + initTestBlobNodeMgrNodes(&testing.T{}, testDiskMgr, 1, 21, testIdcs[0]) + initTestBlobNodeMgrDisks(&testing.T{}, testDiskMgr, 1, 1200, false, testIdcs[0]) testDiskMgr.cfg.HostAware = true testDiskMgr.cfg.RackAware = false diff --git a/blobstore/clustermgr/shard_test.go b/blobstore/clustermgr/shard_test.go index d7ac7b777..527a54795 100644 --- a/blobstore/clustermgr/shard_test.go +++ b/blobstore/clustermgr/shard_test.go @@ -395,8 +395,7 @@ func BenchmarkService_ShardReport(b *testing.B) { b.ResetTimer() b.RunParallel(func(pb *testing.PB) { for pb.Next() { - _, err := cmClient.ReportShard(ctx, args) - require.NoError(b, err) + cmClient.ReportShard(ctx, args) } }) } diff --git a/blobstore/clustermgr/volume_test.go b/blobstore/clustermgr/volume_test.go index 195a952ab..20f312033 100644 --- a/blobstore/clustermgr/volume_test.go +++ b/blobstore/clustermgr/volume_test.go @@ -607,7 +607,7 @@ func generateVolume(volumeDBPath, NormalDBPath string) error { return nil } -func BenchmarkService_ChunkSetCompact(b *testing.B) { +func BenchmarkRunCIService_ChunkSetCompact(b *testing.B) { testService, clean := initServiceWithData() defer clean() cmClient := initTestClusterClient(testService) @@ -626,7 +626,7 @@ func BenchmarkService_ChunkSetCompact(b *testing.B) { } } -func BenchmarkService_VolumeAlloc(b *testing.B) { +func BenchmarkRunCIService_VolumeAlloc(b *testing.B) { testService, clean := initServiceWithData() defer clean() cmClient := initTestClusterClient(testService) @@ -640,14 +640,12 @@ func BenchmarkService_VolumeAlloc(b *testing.B) { b.ResetTimer() b.RunParallel(func(pb *testing.PB) { for pb.Next() { - ret, err := cmClient.AllocVolume(ctx, args) - require.Equal(b, len(ret.AllocVolumeInfos), 3) - require.NoError(b, err) + cmClient.AllocVolume(ctx, args) } }) } -func BenchmarkService_VolumeListAndListV2(b *testing.B) { +func BenchmarkRunCIService_VolumeListAndListV2(b *testing.B) { testService, clean := initServiceWithData() defer clean() cmClient := initTestClusterClient(testService) @@ -666,7 +664,7 @@ func BenchmarkService_VolumeListAndListV2(b *testing.B) { }) } -func BenchmarkService_ChunkReport(b *testing.B) { +func BenchmarkRunCIService_ChunkReport(b *testing.B) { testService, clean := initServiceWithData() defer clean() cmClient := initTestClusterClient(testService) diff --git a/blobstore/clustermgr/volumemgr/volumemgr_test.go b/blobstore/clustermgr/volumemgr/volumemgr_test.go index 6b3c26ee3..3611758a5 100644 --- a/blobstore/clustermgr/volumemgr/volumemgr_test.go +++ b/blobstore/clustermgr/volumemgr/volumemgr_test.go @@ -1196,9 +1196,7 @@ func BenchmarkVolumeMgr_AllocVolume(b *testing.B) { b.ResetTimer() b.RunParallel(func(pb *testing.PB) { for pb.Next() { - ret, err := mockVolumeMgr.AllocVolume(ctx, mode, len(args.Vids), args.Host) - require.NoError(b, err) - require.Equal(b, len(ret.AllocVolumeInfos), 2) + mockVolumeMgr.AllocVolume(ctx, mode, len(args.Vids), args.Host) } }) } @@ -1363,7 +1361,7 @@ func TestPreAlloc_HighWatermarkFallback(t *testing.T) { }) } -func BenchmarkVolumeMgr_PreAllocVolume(b *testing.B) { +func BenchmarkRunCIVolumeMgr_PreAllocVolume(b *testing.B) { _, ctx := trace.StartSpanFromContext(context.Background(), "") mode := codemode.EC15P12 testConfig.checkAndFix() diff --git a/blobstore/clustermgr/volumemgr/volumeunit_test.go b/blobstore/clustermgr/volumemgr/volumeunit_test.go index 59620666a..2e0540eeb 100644 --- a/blobstore/clustermgr/volumemgr/volumeunit_test.go +++ b/blobstore/clustermgr/volumemgr/volumeunit_test.go @@ -538,7 +538,7 @@ func TestVolumeMgr_AllocVolumeUnit_EpochOverflow(t *testing.T) { require.ErrorIs(t, err, ErrVolumeUnitEpochOverflow) } -func BenchmarkVolumeMgr_ChunkReport(b *testing.B) { +func BenchmarkRunCIVolumeMgr_ChunkReport(b *testing.B) { mockVolumeMgr, clean := initMockVolumeMgr(b) defer clean() diff --git a/blobstore/proxy/allocator/volumemgr_test.go b/blobstore/proxy/allocator/volumemgr_test.go index d111fe8ff..355b743c2 100644 --- a/blobstore/proxy/allocator/volumemgr_test.go +++ b/blobstore/proxy/allocator/volumemgr_test.go @@ -200,7 +200,7 @@ func TestGetAllocList(t *testing.T) { } } -func BenchmarkVolumeMgr_Alloc(b *testing.B) { +func BenchmarkRunCIVolumeMgr_Alloc(b *testing.B) { cmcli := mock.ProxyMockClusterMgrCli(b) ctx := context.Background() bidMgr, _ := NewBidMgr(ctx, BlobConfig{BidAllocNums: 100000}, cmcli) @@ -246,7 +246,7 @@ func BenchmarkVolumeMgr_Alloc(b *testing.B) { } } -func BenchmarkAllocByBackup(b *testing.B) { +func BenchmarkRunCIAllocByBackup(b *testing.B) { cmcli := mock.ProxyMockClusterMgrCli(b) ctx := context.Background() bidMgr, _ := NewBidMgr(ctx, BlobConfig{BidAllocNums: 100000}, cmcli) diff --git a/blobstore/scheduler/cluster_topology_test.go b/blobstore/scheduler/cluster_topology_test.go index 1235b130d..bc5039ba6 100644 --- a/blobstore/scheduler/cluster_topology_test.go +++ b/blobstore/scheduler/cluster_topology_test.go @@ -258,7 +258,7 @@ func TestDoubleCheckedRun(t *testing.T) { } } -func BenchmarkVolumeCache(b *testing.B) { +func BenchmarkRunCIVolumeCache(b *testing.B) { for _, cs := range []struct { Name string Items int