Skip to content

Commit

Permalink
fix(test): add parallel statement for qrm tests
Browse files Browse the repository at this point in the history
  • Loading branch information
csfldf committed May 6, 2024
1 parent 17410b8 commit 29d67e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/agent/qrm-plugins/cpu/dynamicpolicy/state/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2544,6 +2544,7 @@ func TestGetSocketTopology(t *testing.T) {
}
}
func TestAllocationInfo_GetSpecifiedNUMABindingPoolName(t *testing.T) {
t.Parallel()
testName := "test"

type fields struct {
Expand Down Expand Up @@ -2705,7 +2706,9 @@ func TestAllocationInfo_GetSpecifiedNUMABindingPoolName(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
ai := &AllocationInfo{
PodUid: tt.fields.PodUid,
PodNamespace: tt.fields.PodNamespace,
Expand Down Expand Up @@ -2740,6 +2743,7 @@ func TestAllocationInfo_GetSpecifiedNUMABindingPoolName(t *testing.T) {
}

func TestCheckNUMABindingSharedCoresAntiAffinity(t *testing.T) {
t.Parallel()
testName := "test"
type args struct {
ai *AllocationInfo
Expand Down Expand Up @@ -2867,7 +2871,9 @@ func TestCheckNUMABindingSharedCoresAntiAffinity(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
if got := CheckNUMABindingSharedCoresAntiAffinity(tt.args.ai, tt.args.annotations); got != tt.want {
t.Errorf("CheckNUMABindingSharedCoresAntiAffinity() = %v, want %v", got, tt.want)
}
Expand All @@ -2876,6 +2882,7 @@ func TestCheckNUMABindingSharedCoresAntiAffinity(t *testing.T) {
}

func TestPodEntries_GetFilteredPoolsCPUSetMap(t *testing.T) {
t.Parallel()
testName := "test"
type args struct {
ignorePools sets.String
Expand Down Expand Up @@ -3089,7 +3096,9 @@ func TestPodEntries_GetFilteredPoolsCPUSetMap(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
got, err := tt.pe.GetFilteredPoolsCPUSetMap(tt.args.ignorePools)
if (err != nil) != tt.wantErr {
t.Errorf("PodEntries.GetFilteredPoolsCPUSetMap() error = %v, wantErr %v", err, tt.wantErr)
Expand Down
3 changes: 3 additions & 0 deletions pkg/agent/qrm-plugins/cpu/dynamicpolicy/state/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ func TestGetSpecifiedPoolName(t *testing.T) {
}

func TestCountAllocationInfosToPoolsQuantityMap(t *testing.T) {
t.Parallel()
testName := "test"
SetContainerRequestedCores(func(allocationInfo *AllocationInfo) float64 {
return allocationInfo.RequestQuantity
Expand Down Expand Up @@ -848,7 +849,9 @@ func TestCountAllocationInfosToPoolsQuantityMap(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
if err := CountAllocationInfosToPoolsQuantityMap(tt.args.allocationInfos, tt.args.poolsQuantityMap); (err != nil) != tt.wantErr {
t.Errorf("CountAllocationInfosToPoolsQuantityMap() error = %v, wantErr %v", err, tt.wantErr)
} else if err == nil {
Expand Down

0 comments on commit 29d67e2

Please sign in to comment.