From b777c62a66dec2652cd0613c61453ef409c814fa Mon Sep 17 00:00:00 2001 From: "wangzhe.21" Date: Mon, 15 Apr 2024 11:16:37 +0800 Subject: [PATCH] add the call to method parallel in realtime overcommit test --- .../plugin/overcommitmentaware/realtime/realtime_test.go | 3 +++ .../plugin/overcommitmentaware/reporter/reporter_test.go | 1 + pkg/controller/overcommit/node/node_test.go | 2 ++ 3 files changed, 6 insertions(+) diff --git a/pkg/agent/sysadvisor/plugin/overcommitmentaware/realtime/realtime_test.go b/pkg/agent/sysadvisor/plugin/overcommitmentaware/realtime/realtime_test.go index bb48df668..94040c8cd 100644 --- a/pkg/agent/sysadvisor/plugin/overcommitmentaware/realtime/realtime_test.go +++ b/pkg/agent/sysadvisor/plugin/overcommitmentaware/realtime/realtime_test.go @@ -376,7 +376,10 @@ func TestUpdate(t *testing.T) { conf := generateTestConfiguration(t, checkpointDir, statefileDir, "testNode") for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + ms := generateTestMetaServer(t, conf, tc.pods, tc.containerMetrics, tc.node) r := NewRealtimeOvercommitmentAdvisor(config.NewConfiguration(), ms, metrics.DummyMetrics{}) err := r.update() diff --git a/pkg/agent/sysadvisor/plugin/overcommitmentaware/reporter/reporter_test.go b/pkg/agent/sysadvisor/plugin/overcommitmentaware/reporter/reporter_test.go index 34e23418c..2c6372e84 100644 --- a/pkg/agent/sysadvisor/plugin/overcommitmentaware/reporter/reporter_test.go +++ b/pkg/agent/sysadvisor/plugin/overcommitmentaware/reporter/reporter_test.go @@ -116,6 +116,7 @@ func TestGetReportContent(t *testing.T) { } func TestStart(t *testing.T) { + t.Parallel() p := &OvercommitRatioReporterPlugin{ manager: NewFakeOvercommitManager(map[v1.ResourceName]float64{ v1.ResourceCPU: 1.5123, diff --git a/pkg/controller/overcommit/node/node_test.go b/pkg/controller/overcommit/node/node_test.go index d7e52d530..ec3ad93a6 100644 --- a/pkg/controller/overcommit/node/node_test.go +++ b/pkg/controller/overcommit/node/node_test.go @@ -693,7 +693,9 @@ func TestNodeOvercommitResource(t *testing.T) { } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() gc, err := katalyst_base.GenerateFakeGenericContext() assert.NoError(t, err) _, err = gc.Client.InternalClient.NodeV1alpha1().CustomNodeResources().Create(context.TODO(), tc.kcnr, metav1.CreateOptions{})