diff --git a/test/e2e/performanceprofile/functests/10_performance_ppc/ppc.go b/test/e2e/performanceprofile/functests/10_performance_ppc/ppc.go index 51c9886235..0b1d3de687 100644 --- a/test/e2e/performanceprofile/functests/10_performance_ppc/ppc.go +++ b/test/e2e/performanceprofile/functests/10_performance_ppc/ppc.go @@ -12,7 +12,6 @@ import ( performancev2 "github.com/openshift/cluster-node-tuning-operator/pkg/apis/performanceprofile/v2" testutils "github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils" "github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/label" - testlog "github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/log" "k8s.io/utils/cpuset" "sigs.k8s.io/yaml" ) @@ -120,9 +119,7 @@ var _ = Describe("[rfe_id: 38968] PerformanceProfile setup helper and platform a errString := "Error: failed to obtain data from flags not appropriate to split reserved CPUs in case of topology-manager-policy: single-numa-node" ok, err := regexp.MatchString(errString, string(output)) Expect(err).ToNot(HaveOccurred()) - if ok { - testlog.Info(errString) - } + Expect(ok).To(BeTrue(), "expected error %q not found in output: %s", errString, output) Eventually(session).Should(gexec.Exit(1)) }) @@ -144,9 +141,7 @@ var _ = Describe("[rfe_id: 38968] PerformanceProfile setup helper and platform a errString := "Error: failed to compute the reserved and isolated CPUs: can't allocate odd number of CPUs from a NUMA Node" ok, err := regexp.MatchString(errString, string(output)) Expect(err).ToNot(HaveOccurred(), "did not fail with Expected:%s failure", errString) - if ok { - testlog.Info(errString) - } + Expect(ok).To(BeTrue(), "expected error %q not found in output: %s", errString, output) Eventually(session).Should(gexec.Exit(1)) }) @@ -169,9 +164,7 @@ var _ = Describe("[rfe_id: 38968] PerformanceProfile setup helper and platform a errString := "Error: failed to compute the reserved and isolated CPUs: please specify the reserved CPU count in the range [1,3]" ok, err := regexp.MatchString(errString, string(output)) Expect(err).ToNot(HaveOccurred(), "did not fail with Expected:%s failure", errString) - if ok { - testlog.Info(errString) - } + Expect(ok).To(BeTrue(), "expected error %q not found in output: %s", errString, output) Eventually(session).Should(gexec.Exit(1)) }) @@ -217,9 +210,7 @@ var _ = Describe("[rfe_id: 38968] PerformanceProfile setup helper and platform a errString := `please use one of \[default low-latency\] power consumption modes together with the perPodPowerManagement` ok, err := regexp.MatchString(errString, string(output)) Expect(err).ToNot(HaveOccurred(), "did not fail with Expected:%s failure", errString) - if ok { - testlog.Info(errString) - } + Expect(ok).To(BeTrue(), "expected error %q not found in output: %s", errString, output) Eventually(session).Should(gexec.Exit(1)) }) }) diff --git a/test/e2e/performanceprofile/functests/11_mixedcpus/mixedcpus.go b/test/e2e/performanceprofile/functests/11_mixedcpus/mixedcpus.go index fcd5914c39..64c78d8c0d 100644 --- a/test/e2e/performanceprofile/functests/11_mixedcpus/mixedcpus.go +++ b/test/e2e/performanceprofile/functests/11_mixedcpus/mixedcpus.go @@ -320,8 +320,8 @@ var _ = Describe("Mixedcpus", Ordered, Label(string(label.MixedCPUs)), func() { By(fmt.Sprintf("Waiting when %s finishes updates", poolName)) profilesupdate.WaitForTuningUpdated(context.TODO(), profile) - Expect(testclient.ControlPlaneClient.Get(ctx, client.ObjectKeyFromObject(profile), profile)) - testlog.Infof("new isolated CPU set=%q\nnew shared CPU set=%q", string(*profile.Spec.CPU.Isolated), string(*profile.Spec.CPU.Isolated)) + Expect(testclient.ControlPlaneClient.Get(ctx, client.ObjectKeyFromObject(profile), profile)).To(Succeed()) + testlog.Infof("new isolated CPU set=%q\nnew shared CPU set=%q", string(*profile.Spec.CPU.Isolated), string(*profile.Spec.CPU.Shared)) // we do not bother to revert the profile at the end of the test, since its irrelevant which of the cpus are shared }) @@ -502,7 +502,7 @@ var _ = Describe("Mixedcpus", Ordered, Label(string(label.MixedCPUs)), func() { Expect(pod.Status.Phase).To(Equal(corev1.PodPending), "Pod %s is not in the pending state", pod.Name) By("Reverting the cluster to previous state") - Expect(testclient.ControlPlaneClient.Get(ctx, client.ObjectKeyFromObject(profile), profile)) + Expect(testclient.ControlPlaneClient.Get(ctx, client.ObjectKeyFromObject(profile), profile)).To(Succeed()) profile.Spec.CPU.Shared = cpuSetToPerformanceCPUSet(ppShared) profile.Spec.WorkloadHints.MixedCpus = ptr.To(true) profiles.UpdateWithRetry(profile) @@ -872,7 +872,7 @@ func setup(ctx context.Context) func(ctx2 context.Context) { teardown := func(ctx2 context.Context) { By(fmt.Sprintf("executing teardown - revert profile %q back to its initial state", profile.Name)) - Expect(testclient.ControlPlaneClient.Get(ctx2, client.ObjectKeyFromObject(initialProfile), profile)) + Expect(testclient.ControlPlaneClient.Get(ctx2, client.ObjectKeyFromObject(initialProfile), profile)).To(Succeed()) profiles.UpdateWithRetry(initialProfile) // do not wait if nothing has changed diff --git a/test/e2e/performanceprofile/functests/2_performance_update/updating_profile.go b/test/e2e/performanceprofile/functests/2_performance_update/updating_profile.go index ce53fbd917..d28c71333e 100644 --- a/test/e2e/performanceprofile/functests/2_performance_update/updating_profile.go +++ b/test/e2e/performanceprofile/functests/2_performance_update/updating_profile.go @@ -637,7 +637,7 @@ var _ = Describe("[rfe_id:28761][performance] Updating parameters in performance Expect(err).ToNot(HaveOccurred()) offlinedCPUSetProfile, err := cpuset.Parse(string(offlined)) Expect(err).ToNot(HaveOccurred()) - Expect(offlinedCPUSet.Equals(offlinedCPUSetProfile)) + Expect(offlinedCPUSet.Equals(offlinedCPUSetProfile)).To(BeTrue(), "offlined CPUs mismatch: expected %q, got %q", offlinedCPUSetProfile, offlinedCPUSet) } }) @@ -707,7 +707,7 @@ var _ = Describe("[rfe_id:28761][performance] Updating parameters in performance Expect(err).ToNot(HaveOccurred()) offlinedCPUSetProfile, err := cpuset.Parse(string(offlinedSet)) Expect(err).ToNot(HaveOccurred()) - Expect(offlinedCPUSet.Equals(offlinedCPUSetProfile)) + Expect(offlinedCPUSet.Equals(offlinedCPUSetProfile)).To(BeTrue(), "offlined CPUs mismatch: expected %q, got %q", offlinedCPUSetProfile, offlinedCPUSet) } }) @@ -770,7 +770,7 @@ var _ = Describe("[rfe_id:28761][performance] Updating parameters in performance Expect(err).ToNot(HaveOccurred()) offlinedCPUSetProfile, err := cpuset.Parse(string(offlinedSet)) Expect(err).ToNot(HaveOccurred()) - Expect(offlinedCPUSet.Equals(offlinedCPUSetProfile)) + Expect(offlinedCPUSet.Equals(offlinedCPUSetProfile)).To(BeTrue(), "offlined CPUs mismatch: expected %q, got %q", offlinedCPUSetProfile, offlinedCPUSet) } }) @@ -840,7 +840,7 @@ var _ = Describe("[rfe_id:28761][performance] Updating parameters in performance Expect(err).ToNot(HaveOccurred()) offlinedCPUSetProfile, err := cpuset.Parse(string(offlinedSet)) Expect(err).ToNot(HaveOccurred()) - Expect(offlinedCPUSet.Equals(offlinedCPUSetProfile)) + Expect(offlinedCPUSet.Equals(offlinedCPUSetProfile)).To(BeTrue(), "offlined CPUs mismatch: expected %q, got %q", offlinedCPUSetProfile, offlinedCPUSet) } }) @@ -966,7 +966,7 @@ var _ = Describe("[rfe_id:28761][performance] Updating parameters in performance Expect(err).ToNot(HaveOccurred()) offlinedCPUSetProfile, err := cpuset.Parse(string(offlinedSet)) Expect(err).ToNot(HaveOccurred()) - Expect(offlinedCPUSet.Equals(offlinedCPUSetProfile)) + Expect(offlinedCPUSet.Equals(offlinedCPUSetProfile)).To(BeTrue(), "offlined CPUs mismatch: expected %q, got %q", offlinedCPUSetProfile, offlinedCPUSet) } })