Skip to content

Commit 9a776cb

Browse files
committed
kubelet pod-resources: e2e node test add failure description ExpectNoError
Signed-off-by: Moshe Levi <[email protected]>
1 parent 37937bb commit 9a776cb

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

test/e2e_node/podresources_test.go

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ func podresourcesListTests(ctx context.Context, f *framework.Framework, cli kube
293293
var err error
294294
ginkgo.By("checking the output when no pods are present")
295295
found, err = getPodResourcesValues(ctx, cli)
296-
framework.ExpectNoError(err)
296+
framework.ExpectNoError(err, "getPodResourcesValues() failed err: %v", err)
297297
gomega.ExpectWithOffset(1, found).To(gomega.HaveLen(expectedBasePods), "base pod expectation mismatch")
298298

299299
tpd = newTestPodData()
@@ -606,7 +606,7 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
606606

607607
ginkgo.It("should return the expected responses", func(ctx context.Context) {
608608
onlineCPUs, err := getOnlineCPUs()
609-
framework.ExpectNoError(err)
609+
framework.ExpectNoError(err, "getOnlineCPUs() failed err: %v", err)
610610

611611
configMap := getSRIOVDevicePluginConfigMap(framework.TestContext.SriovdpConfigMapFile)
612612
sd := setupSRIOVConfigOrFail(ctx, f, configMap)
@@ -615,10 +615,10 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
615615
waitForSRIOVResources(ctx, f, sd)
616616

617617
endpoint, err := util.LocalEndpoint(defaultPodResourcesPath, podresources.Socket)
618-
framework.ExpectNoError(err)
618+
framework.ExpectNoError(err, "LocalEndpoint() failed err: %v", err)
619619

620620
cli, conn, err := podresources.GetV1Client(endpoint, defaultPodResourcesTimeout, defaultPodResourcesMaxSize)
621-
framework.ExpectNoError(err)
621+
framework.ExpectNoError(err, "GetV1Client() failed err: %v", err)
622622
defer conn.Close()
623623

624624
waitForSRIOVResources(ctx, f, sd)
@@ -644,10 +644,10 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
644644
waitForSRIOVResources(ctx, f, sd)
645645

646646
endpoint, err := util.LocalEndpoint(defaultPodResourcesPath, podresources.Socket)
647-
framework.ExpectNoError(err)
647+
framework.ExpectNoError(err, "LocalEndpoint() failed err: %v", err)
648648

649649
cli, conn, err := podresources.GetV1Client(endpoint, defaultPodResourcesTimeout, defaultPodResourcesMaxSize)
650-
framework.ExpectNoError(err)
650+
framework.ExpectNoError(err, "GetV1Client() failed err: %v", err)
651651
defer conn.Close()
652652

653653
waitForSRIOVResources(ctx, f, sd)
@@ -690,13 +690,13 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
690690

691691
ginkgo.It("should return the expected responses", func(ctx context.Context) {
692692
onlineCPUs, err := getOnlineCPUs()
693-
framework.ExpectNoError(err)
693+
framework.ExpectNoError(err, "getOnlineCPUs() failed err: %v", err)
694694

695695
endpoint, err := util.LocalEndpoint(defaultPodResourcesPath, podresources.Socket)
696-
framework.ExpectNoError(err)
696+
framework.ExpectNoError(err, "LocalEndpoint() failed err: %v", err)
697697

698698
cli, conn, err := podresources.GetV1Client(endpoint, defaultPodResourcesTimeout, defaultPodResourcesMaxSize)
699-
framework.ExpectNoError(err)
699+
framework.ExpectNoError(err, "GetV1Client() failed err: %v", err)
700700
defer conn.Close()
701701

702702
podresourcesListTests(ctx, f, cli, nil)
@@ -708,10 +708,10 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
708708
ginkgo.Context("with CPU manager None policy", func() {
709709
ginkgo.It("should return the expected responses", func(ctx context.Context) {
710710
endpoint, err := util.LocalEndpoint(defaultPodResourcesPath, podresources.Socket)
711-
framework.ExpectNoError(err)
711+
framework.ExpectNoError(err, "LocalEndpoint() failed err: %v", err)
712712

713713
cli, conn, err := podresources.GetV1Client(endpoint, defaultPodResourcesTimeout, defaultPodResourcesMaxSize)
714-
framework.ExpectNoError(err)
714+
framework.ExpectNoError(err, "GetV1Client() failed err: %v", err)
715715
defer conn.Close()
716716

717717
// intentionally passing empty cpuset instead of onlineCPUs because with none policy
@@ -730,10 +730,10 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
730730

731731
ginkgo.It("should return the expected error with the feature gate disabled", func(ctx context.Context) {
732732
endpoint, err := util.LocalEndpoint(defaultPodResourcesPath, podresources.Socket)
733-
framework.ExpectNoError(err)
733+
framework.ExpectNoError(err, "LocalEndpoint() failed err: %v", err)
734734

735735
cli, conn, err := podresources.GetV1Client(endpoint, defaultPodResourcesTimeout, defaultPodResourcesMaxSize)
736-
framework.ExpectNoError(err)
736+
framework.ExpectNoError(err, "GetV1Client() failed err: %v", err)
737737
defer conn.Close()
738738

739739
ginkgo.By("checking GetAllocatableResources fail if the feature gate is not enabled")
@@ -776,10 +776,10 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
776776
waitForTopologyUnawareResources(ctx, f)
777777

778778
endpoint, err := util.LocalEndpoint(defaultPodResourcesPath, podresources.Socket)
779-
framework.ExpectNoError(err)
779+
framework.ExpectNoError(err, "LocalEndpoint() failed err: %v", err)
780780

781781
cli, conn, err := podresources.GetV1Client(endpoint, defaultPodResourcesTimeout, defaultPodResourcesMaxSize)
782-
framework.ExpectNoError(err)
782+
framework.ExpectNoError(err, "GetV1Client() failed err: %v", err)
783783
defer conn.Close()
784784

785785
ginkgo.By("checking List and resources topology unaware resource should be without topology")
@@ -827,17 +827,17 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
827827
ginkgo.BeforeEach(func(ctx context.Context) {
828828
// ensure APIs have been called at least once
829829
endpoint, err := util.LocalEndpoint(defaultPodResourcesPath, podresources.Socket)
830-
framework.ExpectNoError(err)
830+
framework.ExpectNoError(err, "LocalEndpoint() failed err %v", err)
831831

832832
cli, conn, err := podresources.GetV1Client(endpoint, defaultPodResourcesTimeout, defaultPodResourcesMaxSize)
833-
framework.ExpectNoError(err)
833+
framework.ExpectNoError(err, "GetV1Client() failed err %v", err)
834834
defer conn.Close()
835835

836836
_, err = cli.List(ctx, &kubeletpodresourcesv1.ListPodResourcesRequest{})
837-
framework.ExpectNoError(err)
837+
framework.ExpectNoError(err, "List() failed err %v", err)
838838

839839
_, err = cli.GetAllocatableResources(ctx, &kubeletpodresourcesv1.AllocatableResourcesRequest{})
840-
framework.ExpectNoError(err)
840+
framework.ExpectNoError(err, "GetAllocatableResources() failed err %v", err)
841841
})
842842

843843
ginkgo.It("should report the values for the podresources metrics", func(ctx context.Context) {
@@ -869,11 +869,11 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
869869
ginkgo.It("should hit throttling when calling podresources List in a tight loop", func(ctx context.Context) {
870870
// ensure APIs have been called at least once
871871
endpoint, err := util.LocalEndpoint(defaultPodResourcesPath, podresources.Socket)
872-
framework.ExpectNoError(err)
872+
framework.ExpectNoError(err, "LocalEndpoint() failed err %v", err)
873873

874874
ginkgo.By("Connecting to the kubelet endpoint")
875875
cli, conn, err := podresources.GetV1Client(endpoint, defaultPodResourcesTimeout, defaultPodResourcesMaxSize)
876-
framework.ExpectNoError(err)
876+
framework.ExpectNoError(err, "GetV1Client() failed err %v", err)
877877
defer conn.Close()
878878

879879
tries := podresourcesgrpc.DefaultQPS * 2 // This should also be greater than DefaultBurstTokens
@@ -935,7 +935,7 @@ func setupSampleDevicePluginOrFail(ctx context.Context, f *framework.Framework)
935935
if err != nil {
936936
framework.Logf("Sample Device Pod %v took too long to enter running/ready: %v", dp.Name, err)
937937
}
938-
framework.ExpectNoError(err)
938+
framework.ExpectNoError(err, "WaitForPodCondition() failed err: %v", err)
939939

940940
return dpPod
941941
}
@@ -948,7 +948,7 @@ func teardownSampleDevicePluginOrFail(ctx context.Context, f *framework.Framewor
948948
ginkgo.By(fmt.Sprintf("Delete sample device plugin pod %s/%s", pod.Namespace, pod.Name))
949949
err := f.ClientSet.CoreV1().Pods(pod.Namespace).Delete(ctx, pod.Name, deleteOptions)
950950

951-
framework.ExpectNoError(err)
951+
framework.ExpectNoError(err, "Failed to delete Pod %v in Namspace %v", pod.Name, pod.Namespace)
952952
waitForAllContainerRemoval(ctx, pod.Name, pod.Namespace)
953953
}
954954

0 commit comments

Comments
 (0)