mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
node: cpumgr: use String representation in output
get nicer output for free Signed-off-by: Francesco Romani <fromani@redhat.com>
This commit is contained in:
parent
52e0f522ba
commit
cea7d97d8b
@ -668,12 +668,12 @@ func runStaticPolicyTestCase(t *testing.T, testCase staticPolicyTest) {
|
||||
}
|
||||
|
||||
if !cset.Equals(testCase.expCSet) {
|
||||
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %v but got %v",
|
||||
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %s but got %s",
|
||||
testCase.description, testCase.expCSet, cset)
|
||||
}
|
||||
|
||||
if !cset.Intersection(st.defaultCPUSet).IsEmpty() {
|
||||
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %v to be disoint from the shared cpuset %v",
|
||||
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %s to be disoint from the shared cpuset %s",
|
||||
testCase.description, cset, st.defaultCPUSet)
|
||||
}
|
||||
}
|
||||
@ -733,7 +733,7 @@ func TestStaticPolicyReuseCPUs(t *testing.T) {
|
||||
policy.Allocate(st, pod, &container)
|
||||
}
|
||||
if !st.defaultCPUSet.Equals(testCase.expCSetAfterAlloc) {
|
||||
t.Errorf("StaticPolicy Allocate() error (%v). expected default cpuset %v but got %v",
|
||||
t.Errorf("StaticPolicy Allocate() error (%v). expected default cpuset %s but got %s",
|
||||
testCase.description, testCase.expCSetAfterAlloc, st.defaultCPUSet)
|
||||
}
|
||||
|
||||
@ -741,7 +741,7 @@ func TestStaticPolicyReuseCPUs(t *testing.T) {
|
||||
policy.RemoveContainer(st, string(pod.UID), testCase.containerName)
|
||||
|
||||
if !st.defaultCPUSet.Equals(testCase.expCSetAfterRemove) {
|
||||
t.Errorf("StaticPolicy RemoveContainer() error (%v). expected default cpuset %v but got %v",
|
||||
t.Errorf("StaticPolicy RemoveContainer() error (%v). expected default cpuset %sv but got %s",
|
||||
testCase.description, testCase.expCSetAfterRemove, st.defaultCPUSet)
|
||||
}
|
||||
if _, found := st.assignments[string(pod.UID)][testCase.containerName]; found {
|
||||
@ -793,7 +793,7 @@ func TestStaticPolicyDoNotReuseCPUs(t *testing.T) {
|
||||
}
|
||||
}
|
||||
if !st.defaultCPUSet.Equals(testCase.expCSetAfterAlloc) {
|
||||
t.Errorf("StaticPolicy Allocate() error (%v). expected default cpuset %v but got %v",
|
||||
t.Errorf("StaticPolicy Allocate() error (%v). expected default cpuset %s but got %s",
|
||||
testCase.description, testCase.expCSetAfterAlloc, st.defaultCPUSet)
|
||||
}
|
||||
}
|
||||
@ -871,7 +871,7 @@ func TestStaticPolicyRemove(t *testing.T) {
|
||||
policy.RemoveContainer(st, testCase.podUID, testCase.containerName)
|
||||
|
||||
if !st.defaultCPUSet.Equals(testCase.expCSet) {
|
||||
t.Errorf("StaticPolicy RemoveContainer() error (%v). expected default cpuset %v but got %v",
|
||||
t.Errorf("StaticPolicy RemoveContainer() error (%v). expected default cpuset %s but got %s",
|
||||
testCase.description, testCase.expCSet, st.defaultCPUSet)
|
||||
}
|
||||
|
||||
@ -1153,12 +1153,12 @@ func TestStaticPolicyAddWithResvList(t *testing.T) {
|
||||
}
|
||||
|
||||
if !cset.Equals(testCase.expCSet) {
|
||||
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %v but got %v",
|
||||
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %s but got %s",
|
||||
testCase.description, testCase.expCSet, cset)
|
||||
}
|
||||
|
||||
if !cset.Intersection(st.defaultCPUSet).IsEmpty() {
|
||||
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %v to be disoint from the shared cpuset %v",
|
||||
t.Errorf("StaticPolicy Allocate() error (%v). expected cpuset %s to be disoint from the shared cpuset %s",
|
||||
testCase.description, cset, st.defaultCPUSet)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user