Skip to content

Commit

Permalink
e2e: remove redundant parentheses and type conversions
Browse files Browse the repository at this point in the history
Signed-off-by: Talor Itzhak <titzhak@redhat.com>
  • Loading branch information
Tal-or committed Jan 9, 2024
1 parent fc4801e commit 2fe3d7f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ func deleteTestPod(ctx context.Context, testpod *corev1.Pod) (types.UID, bool) {
// it possible that the pod already was deleted as part of the test, in this case we want to skip teardown
err := testclient.Client.Get(ctx, client.ObjectKeyFromObject(testpod), testpod)
if errors.IsNotFound(err) {
return types.UID(""), false
return "", false
}

testpodUID := testpod.UID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, func() {
testpod.Spec.NodeSelector = map[string]string{testutils.LabelHostname: workerRTNode.Name}
err = testclient.Client.Create(context.TODO(), testpod)
Expect(err).ToNot(HaveOccurred())
testpod, err = pods.WaitForCondition(context.TODO(), client.ObjectKeyFromObject(testpod), corev1.PodConditionType(corev1.PodReady), corev1.ConditionTrue, 5*time.Minute)
testpod, err = pods.WaitForCondition(context.TODO(), client.ObjectKeyFromObject(testpod), corev1.PodReady, corev1.ConditionTrue, 5*time.Minute)
Expect(err).ToNot(HaveOccurred())
Expect(testpod.Status.QOSClass).To(Equal(corev1.PodQOSGuaranteed))

Expand Down Expand Up @@ -279,7 +279,7 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, func() {
testpod1.Spec.NodeSelector = map[string]string{testutils.LabelHostname: workerRTNode.Name}
err = testclient.Client.Create(context.TODO(), testpod1)
Expect(err).ToNot(HaveOccurred())
testpod1, err = pods.WaitForCondition(context.TODO(), client.ObjectKeyFromObject(testpod1), corev1.PodConditionType(corev1.PodReady), corev1.ConditionTrue, 5*time.Minute)
testpod1, err = pods.WaitForCondition(context.TODO(), client.ObjectKeyFromObject(testpod1), corev1.PodReady, corev1.ConditionTrue, 5*time.Minute)
Expect(err).ToNot(HaveOccurred())
Expect(testpod1.Status.QOSClass).To(Equal(corev1.PodQOSGuaranteed))

Expand All @@ -299,7 +299,7 @@ var _ = Describe("[performance] Cgroups and affinity", Ordered, func() {
testpod2.Spec.NodeSelector = map[string]string{testutils.LabelHostname: workerRTNode.Name}
err = testclient.Client.Create(context.TODO(), testpod2)
Expect(err).ToNot(HaveOccurred())
testpod2, err = pods.WaitForCondition(context.TODO(), client.ObjectKeyFromObject(testpod2), corev1.PodConditionType(corev1.PodReady), corev1.ConditionTrue, 5*time.Minute)
testpod2, err = pods.WaitForCondition(context.TODO(), client.ObjectKeyFromObject(testpod2), corev1.PodReady, corev1.ConditionTrue, 5*time.Minute)
Expect(err).ToNot(HaveOccurred())
Expect(testpod1.Status.QOSClass).To(Equal(corev1.PodQOSGuaranteed))

Expand Down Expand Up @@ -577,7 +577,7 @@ func getOVSServicesPid(ctx context.Context, workerNode *corev1.Node) ([]string,
// TODO: This path is not compatible with cgroupv2.
cmd := []string{"cat", "/rootfs/sys/fs/cgroup/cpuset/ovs.slice/cgroup.procs"}
output, err := nodes.ExecCommandOnNode(ctx, cmd, workerNode)
pids = strings.Split(string(output), "\n")
pids = strings.Split(output, "\n")
return pids, err
}

Expand Down Expand Up @@ -659,7 +659,7 @@ func waitForCondition(deployment *appsv1.Deployment, status appsv1.DeploymentSta
}
return false, err
}
val = (deployment.Status.Replicas == status.Replicas && deployment.Status.AvailableReplicas == status.AvailableReplicas)
val = deployment.Status.Replicas == status.Replicas && deployment.Status.AvailableReplicas == status.AvailableReplicas
return val, err
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
containerCgroup, err = nodes.ExecCommandOnNode(context.TODO(), cmd, &workerRTNodes[0])
Expect(err).ToNot(HaveOccurred())
return containerCgroup
}, (cluster.ComputeTestTimeout(30*time.Second, RunningOnSingleNode)), 5*time.Second).ShouldNot(BeEmpty(),
}, cluster.ComputeTestTimeout(30*time.Second, RunningOnSingleNode), 5*time.Second).ShouldNot(BeEmpty(),
fmt.Sprintf("cannot find cgroup for container %q", containerID))

By("Verify powersetting of cpus used by the pod")
Expand Down Expand Up @@ -805,7 +805,7 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
containerCgroup, err = nodes.ExecCommandOnNode(context.TODO(), cmd, &workerRTNodes[0])
Expect(err).ToNot(HaveOccurred())
return containerCgroup
}, (cluster.ComputeTestTimeout(30*time.Second, RunningOnSingleNode)), 5*time.Second).ShouldNot(BeEmpty(),
}, cluster.ComputeTestTimeout(30*time.Second, RunningOnSingleNode), 5*time.Second).ShouldNot(BeEmpty(),
fmt.Sprintf("cannot find cgroup for container %q", containerID))

By("Verify powersetting of cpus used by the pod")
Expand Down

0 comments on commit 2fe3d7f

Please sign in to comment.