Skip to content

Commit cea7d97

Browse files
committed
node: cpumgr: use String representation in output
get nicer output for free Signed-off-by: Francesco Romani <[email protected]>
1 parent 52e0f52 commit cea7d97

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pkg/kubelet/cm/cpumanager/policy_static_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -668,12 +668,12 @@ func runStaticPolicyTestCase(t *testing.T, testCase staticPolicyTest) {
668668
}
669669

670670
if !cset.Equals(testCase.expCSet) {
671-
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %v but got %v",
671+
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %s but got %s",
672672
testCase.description, testCase.expCSet, cset)
673673
}
674674

675675
if !cset.Intersection(st.defaultCPUSet).IsEmpty() {
676-
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %v to be disoint from the shared cpuset %v",
676+
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %s to be disoint from the shared cpuset %s",
677677
testCase.description, cset, st.defaultCPUSet)
678678
}
679679
}
@@ -733,15 +733,15 @@ func TestStaticPolicyReuseCPUs(t *testing.T) {
733733
policy.Allocate(st, pod, &container)
734734
}
735735
if !st.defaultCPUSet.Equals(testCase.expCSetAfterAlloc) {
736-
t.Errorf("StaticPolicy Allocate() error (%v). expected default cpuset %v but got %v",
736+
t.Errorf("StaticPolicy Allocate() error (%v). expected default cpuset %s but got %s",
737737
testCase.description, testCase.expCSetAfterAlloc, st.defaultCPUSet)
738738
}
739739

740740
// remove
741741
policy.RemoveContainer(st, string(pod.UID), testCase.containerName)
742742

743743
if !st.defaultCPUSet.Equals(testCase.expCSetAfterRemove) {
744-
t.Errorf("StaticPolicy RemoveContainer() error (%v). expected default cpuset %v but got %v",
744+
t.Errorf("StaticPolicy RemoveContainer() error (%v). expected default cpuset %sv but got %s",
745745
testCase.description, testCase.expCSetAfterRemove, st.defaultCPUSet)
746746
}
747747
if _, found := st.assignments[string(pod.UID)][testCase.containerName]; found {
@@ -793,7 +793,7 @@ func TestStaticPolicyDoNotReuseCPUs(t *testing.T) {
793793
}
794794
}
795795
if !st.defaultCPUSet.Equals(testCase.expCSetAfterAlloc) {
796-
t.Errorf("StaticPolicy Allocate() error (%v). expected default cpuset %v but got %v",
796+
t.Errorf("StaticPolicy Allocate() error (%v). expected default cpuset %s but got %s",
797797
testCase.description, testCase.expCSetAfterAlloc, st.defaultCPUSet)
798798
}
799799
}
@@ -871,7 +871,7 @@ func TestStaticPolicyRemove(t *testing.T) {
871871
policy.RemoveContainer(st, testCase.podUID, testCase.containerName)
872872

873873
if !st.defaultCPUSet.Equals(testCase.expCSet) {
874-
t.Errorf("StaticPolicy RemoveContainer() error (%v). expected default cpuset %v but got %v",
874+
t.Errorf("StaticPolicy RemoveContainer() error (%v). expected default cpuset %s but got %s",
875875
testCase.description, testCase.expCSet, st.defaultCPUSet)
876876
}
877877

@@ -1153,12 +1153,12 @@ func TestStaticPolicyAddWithResvList(t *testing.T) {
11531153
}
11541154

11551155
if !cset.Equals(testCase.expCSet) {
1156-
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %v but got %v",
1156+
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %s but got %s",
11571157
testCase.description, testCase.expCSet, cset)
11581158
}
11591159

11601160
if !cset.Intersection(st.defaultCPUSet).IsEmpty() {
1161-
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %v to be disoint from the shared cpuset %v",
1161+
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %s to be disoint from the shared cpuset %s",
11621162
testCase.description, cset, st.defaultCPUSet)
11631163
}
11641164
}

0 commit comments

Comments
 (0)