Skip to content

Commit 3f13f4a

Browse files
committed
e2e: no need to call String()
CPUSet already implement the Stringer interface so everytime we print CPUSet the `String()` function is called anyway. Signed-off-by: Talor Itzhak <titzhak@redhat.com>
1 parent ba8084a commit 3f13f4a

File tree

1 file changed

+21
-21
lines changed
  • test/e2e/performanceprofile/functests/7_performance_kubelet_node

1 file changed

+21
-21
lines changed

test/e2e/performanceprofile/functests/7_performance_kubelet_node/cgroups.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,13 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, Label(string(lab
278278
// we need to wait as process affinity can change
279279
time.Sleep(30 * time.Second)
280280
ctnCpuset := taskSet(ctx, containerPid, workerRTNode)
281-
testlog.Infof("Cpus used by ovn Containers are %s", ctnCpuset.String())
281+
testlog.Infof("Cpus used by ovn Containers are %s", ctnCpuset)
282282
pidList, err := ovsPids(ctx, ovsSystemdServices, workerRTNode)
283283
Expect(err).ToNot(HaveOccurred())
284284
pidToCPUs, err := getCPUMaskForPids(ctx, pidList, workerRTNode)
285285
Expect(err).ToNot(HaveOccurred())
286286
for pid, cpumask := range pidToCPUs {
287-
testlog.Infof("OVS service pid %s is using cpus %s", pid, cpumask.String())
287+
testlog.Infof("OVS service pid %s is using cpus %s", pid, cpumask)
288288
Expect(ctnCpuset.Equals(cpumask)).To(BeTrue(), "affinity of ovn kube node pods(%s) do not match with ovservices pid %s (%s)", ctnCpuset, pid, cpumask)
289289
}
290290

@@ -328,16 +328,16 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, Label(string(lab
328328
// we need to wait as process affinity can change
329329
time.Sleep(30 * time.Second)
330330
ctnCpuset := taskSet(ctx, containerPid, workerRTNode)
331-
testlog.Infof("Container of ovn pod %s is using cpus %s", ovnPod.Name, ctnCpuset.String())
331+
testlog.Infof("Container of ovn pod %s is using cpus %s", ovnPod.Name, ctnCpuset)
332332

333333
pidList, err := ovsPids(ctx, ovsSystemdServices, workerRTNode)
334334
Expect(err).ToNot(HaveOccurred())
335335

336336
pidToCPUs, err := getCPUMaskForPids(ctx, pidList, workerRTNode)
337337
Expect(err).ToNot(HaveOccurred())
338338
for pid, cpumask := range pidToCPUs {
339-
testlog.Infof("OVS service pid %s is using cpus %s", pid, cpumask.String())
340-
Expect(ctnCpuset.Equals(cpumask)).To(BeTrue()), "affinity of ovn kube node pods(%s) do not match with ovservices pid %s (%s)", ctnCpuset.String(), pid, cpumask.String())
339+
testlog.Infof("OVS service pid %s is using cpus %s", pid, cpumask)
340+
Expect(ctnCpuset.Equals(cpumask)).To(BeTrue(), "affinity of ovn kube node pods(%s) do not match with ovservices pid %s (%s)", ctnCpuset, pid, cpumask)
341341
}
342342
deleteTestPod(ctx, testpod)
343343

@@ -401,7 +401,7 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, Label(string(lab
401401
// we need to wait as process affinity can change
402402
time.Sleep(30 * time.Second)
403403
ovnContainerCpuset1 := taskSet(ctx, containerPid, workerRTNode)
404-
testlog.Infof("Container of ovn pod %s is using cpus %s", ovnPod.Name, ovnContainerCpuset1.String())
404+
testlog.Infof("Container of ovn pod %s is using cpus %s", ovnPod.Name, ovnContainerCpuset1)
405405
pidList, err := ovsPids(ctx, ovsSystemdServices, workerRTNode)
406406
Expect(err).ToNot(HaveOccurred())
407407

@@ -411,8 +411,8 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, Label(string(lab
411411
pidToCPUs, err := getCPUMaskForPids(ctx, pidList, workerRTNode)
412412
Expect(err).ToNot(HaveOccurred())
413413
for pid, cpumask := range pidToCPUs {
414-
testlog.Infof("OVS service pid %s is using cpus %s", pid, cpumask.String())
415-
Expect(ovnContainerCpuset1.Equals(cpumask)).To(BeTrue(), "affinity of ovn kube node pods(%s) do not match with ovservices pid %s (%s)", ovnContainerCpuset1.String(), pid, cpumask.String())
414+
testlog.Infof("OVS service pid %s is using cpus %s", pid, cpumask)
415+
Expect(ovnContainerCpuset1.Equals(cpumask)).To(BeTrue(), "affinity of ovn kube node pods(%s) do not match with ovservices pid %s (%s)", ovnContainerCpuset1, pid, cpumask)
416416
}
417417
// Delete testpod1
418418
testlog.Infof("Deleting pod %v", testpod1.Name)
@@ -421,16 +421,16 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, Label(string(lab
421421
time.Sleep(30 * time.Second)
422422
// Check the cpus of ovnkubenode pods
423423
ovnContainerCpuset2 := taskSet(ctx, containerPid, workerRTNode)
424-
testlog.Infof("cpus used by ovn kube node pods after deleting pod %v is %v", testpod1.Name, ovnContainerCpuset2.String())
424+
testlog.Infof("cpus used by ovn kube node pods after deleting pod %v is %v", testpod1.Name, ovnContainerCpuset2)
425425
// we wait some time for ovs process affinity to change
426426
time.Sleep(30 * time.Second)
427427

428428
// Verify ovs-vswitchd and ovsdb-server process affinity is updated
429429
pidToCPUs, err = getCPUMaskForPids(ctx, pidList, workerRTNode)
430430
Expect(err).ToNot(HaveOccurred())
431431
for pid, cpumask := range pidToCPUs {
432-
testlog.Infof("OVS service pid %s is using cpus %s", pid, cpumask.String())
433-
Expect(ovnContainerCpuset2.Equals(cpumask)).To(BeTrue(), "affinity of ovn kube node pods(%s) do not match with ovservices pid %s (%s)", ovnContainerCpuset2.String(), pid, cpumask.String())
432+
testlog.Infof("OVS service pid %s is using cpus %s", pid, cpumask)
433+
Expect(ovnContainerCpuset2.Equals(cpumask)).To(BeTrue(), "affinity of ovn kube node pods(%s) do not match with ovservices pid %s (%s)", ovnContainerCpuset2, pid, cpumask)
434434
}
435435
// Delete testpod2
436436
deleteTestPod(context.TODO(), testpod2)
@@ -464,7 +464,7 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, Label(string(lab
464464
// of ovs services should contain all cpus , which is generally 0-N (where
465465
// N is total number of cpus, this should be easy to compare.
466466
if !cpumask.Equals(onlineCPUSet) {
467-
testlog.Warningf("ovs servics pid %s cpu mask is %s instead of %s", pid, cpumask.String(), onlineCPUSet.String())
467+
testlog.Warningf("ovs servics pid %s cpu mask is %s instead of %s", pid, cpumask, onlineCPUSet)
468468
return false
469469
}
470470
}
@@ -481,7 +481,7 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, Label(string(lab
481481
// we need to wait as process affinity can change
482482
time.Sleep(30 * time.Second)
483483
ovnContainerCpuset := taskSet(ctx, containerPid, workerRTNode)
484-
testlog.Infof("Container of ovn pod %s is using cpus %s", ovnPod.Name, ovnContainerCpuset.String())
484+
testlog.Infof("Container of ovn pod %s is using cpus %s", ovnPod.Name, ovnContainerCpuset)
485485
pidList, err := ovsPids(ctx, ovsSystemdServices, workerRTNode)
486486
Expect(err).ToNot(HaveOccurred())
487487

@@ -491,8 +491,8 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, Label(string(lab
491491
pidToCPUs1, err := getCPUMaskForPids(ctx, pidList, workerRTNode)
492492
Expect(err).ToNot(HaveOccurred())
493493
for pid, cpumask := range pidToCPUs1 {
494-
testlog.Infof("OVS service pid %s is using cpus %s", pid, cpumask.String())
495-
Expect(ovnContainerCpuset).To(Equal(cpumask), "affinity of ovn kube node pods(%s) do not match with ovservices pid %s (%s)", ovnContainerCpuset.String(), pid, cpumask.String())
494+
testlog.Infof("OVS service pid %s is using cpus %s", pid, cpumask)
495+
Expect(ovnContainerCpuset).To(Equal(cpumask), "affinity of ovn kube node pods(%s) do not match with ovservices pid %s (%s)", ovnContainerCpuset, pid, cpumask)
496496
}
497497

498498
testlog.Info("Rebooting the node")
@@ -540,7 +540,7 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, Label(string(lab
540540
// we need to wait as process affinity can change
541541
time.Sleep(30 * time.Second)
542542
ovnContainerCpusetAfterReboot := taskSet(ctx, containerPid, workerRTNode)
543-
testlog.Infof("cpus used by ovn kube node pods %v", ovnContainerCpusetAfterReboot.String())
543+
testlog.Infof("cpus used by ovn kube node pods %v", ovnContainerCpusetAfterReboot)
544544
pidListAfterReboot, err := ovsPids(ctx, ovsSystemdServices, workerRTNode)
545545

546546
Expect(err).ToNot(HaveOccurred())
@@ -549,8 +549,8 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, Label(string(lab
549549
pidToCPUs2, err := getCPUMaskForPids(ctx, pidListAfterReboot, workerRTNode)
550550
Expect(err).ToNot(HaveOccurred())
551551
for pid, cpumask := range pidToCPUs2 {
552-
testlog.Infof("OVS service pid %s is using cpus %s", pid, cpumask.String())
553-
Expect(ovnContainerCpusetAfterReboot).To(Equal(cpumask), "affinity of ovn kube node pods(%s) do not match with ovservices pid %s (%s)", ovnContainerCpusetAfterReboot.String(), pid, cpumask.String())
552+
testlog.Infof("OVS service pid %s is using cpus %s", pid, cpumask)
553+
Expect(ovnContainerCpusetAfterReboot).To(Equal(cpumask), "affinity of ovn kube node pods(%s) do not match with ovservices pid %s (%s)", ovnContainerCpusetAfterReboot, pid, cpumask)
554554
}
555555
})
556556

@@ -595,7 +595,7 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, Label(string(lab
595595
Expect(err).ToNot(HaveOccurred())
596596
for pid, cpumask := range pidToCPUs {
597597
if !cpumask.Equals(onlineCPUSet) {
598-
testlog.Warningf("ovs servics pid %s cpu mask is %s instead of %s", pid, cpumask.String(), onlineCPUSet.String())
598+
testlog.Warningf("ovs servics pid %s cpu mask is %s instead of %s", pid, cpumask, onlineCPUSet)
599599
return false
600600
}
601601
}
@@ -646,7 +646,7 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, Label(string(lab
646646
cpumask := strings.Split(line, ":")
647647
threadsCpuset, err := cpuset.Parse(strings.TrimSpace(cpumask[1]))
648648
Expect(err).ToNot(HaveOccurred())
649-
testlog.Infof("ovs-switchd thread CpuAffinity: %s, pod %s Affinity: %s", threadsCpuset.String(), pod.Name, podcpus.String())
649+
testlog.Infof("ovs-switchd thread CpuAffinity: %s, pod %s Affinity: %s", threadsCpuset, pod.Name, podcpus)
650650
Expect(podcpus.IsSubsetOf(threadsCpuset)).To(Equal(false))
651651
}
652652
}
@@ -706,7 +706,7 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, Label(string(lab
706706
cpumask := strings.Split(line, ":")
707707
threadsCpuset, err := cpuset.Parse(strings.TrimSpace(cpumask[1]))
708708
Expect(err).ToNot(HaveOccurred())
709-
testlog.Infof("ovs-switchd thread CpuAffinity: %s, pod %s Affinity: %s", threadsCpuset.String(), pod.Name, podcpus.String())
709+
testlog.Infof("ovs-switchd thread CpuAffinity: %s, pod %s Affinity: %s", threadsCpuset, pod.Name, podcpus)
710710
Expect(podcpus.IsSubsetOf(threadsCpuset)).To(Equal(false))
711711
}
712712
}

0 commit comments

Comments
 (0)