@@ -293,7 +293,7 @@ func podresourcesListTests(ctx context.Context, f *framework.Framework, cli kube
293
293
var err error
294
294
ginkgo .By ("checking the output when no pods are present" )
295
295
found , err = getPodResourcesValues (ctx , cli )
296
- framework .ExpectNoError (err )
296
+ framework .ExpectNoError (err , "getPodResourcesValues() failed err: %v" , err )
297
297
gomega .ExpectWithOffset (1 , found ).To (gomega .HaveLen (expectedBasePods ), "base pod expectation mismatch" )
298
298
299
299
tpd = newTestPodData ()
@@ -606,7 +606,7 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
606
606
607
607
ginkgo .It ("should return the expected responses" , func (ctx context.Context ) {
608
608
onlineCPUs , err := getOnlineCPUs ()
609
- framework .ExpectNoError (err )
609
+ framework .ExpectNoError (err , "getOnlineCPUs() failed err: %v" , err )
610
610
611
611
configMap := getSRIOVDevicePluginConfigMap (framework .TestContext .SriovdpConfigMapFile )
612
612
sd := setupSRIOVConfigOrFail (ctx , f , configMap )
@@ -615,10 +615,10 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
615
615
waitForSRIOVResources (ctx , f , sd )
616
616
617
617
endpoint , err := util .LocalEndpoint (defaultPodResourcesPath , podresources .Socket )
618
- framework .ExpectNoError (err )
618
+ framework .ExpectNoError (err , "LocalEndpoint() failed err: %v" , err )
619
619
620
620
cli , conn , err := podresources .GetV1Client (endpoint , defaultPodResourcesTimeout , defaultPodResourcesMaxSize )
621
- framework .ExpectNoError (err )
621
+ framework .ExpectNoError (err , "GetV1Client() failed err: %v" , err )
622
622
defer conn .Close ()
623
623
624
624
waitForSRIOVResources (ctx , f , sd )
@@ -644,10 +644,10 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
644
644
waitForSRIOVResources (ctx , f , sd )
645
645
646
646
endpoint , err := util .LocalEndpoint (defaultPodResourcesPath , podresources .Socket )
647
- framework .ExpectNoError (err )
647
+ framework .ExpectNoError (err , "LocalEndpoint() failed err: %v" , err )
648
648
649
649
cli , conn , err := podresources .GetV1Client (endpoint , defaultPodResourcesTimeout , defaultPodResourcesMaxSize )
650
- framework .ExpectNoError (err )
650
+ framework .ExpectNoError (err , "GetV1Client() failed err: %v" , err )
651
651
defer conn .Close ()
652
652
653
653
waitForSRIOVResources (ctx , f , sd )
@@ -690,13 +690,13 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
690
690
691
691
ginkgo .It ("should return the expected responses" , func (ctx context.Context ) {
692
692
onlineCPUs , err := getOnlineCPUs ()
693
- framework .ExpectNoError (err )
693
+ framework .ExpectNoError (err , "getOnlineCPUs() failed err: %v" , err )
694
694
695
695
endpoint , err := util .LocalEndpoint (defaultPodResourcesPath , podresources .Socket )
696
- framework .ExpectNoError (err )
696
+ framework .ExpectNoError (err , "LocalEndpoint() failed err: %v" , err )
697
697
698
698
cli , conn , err := podresources .GetV1Client (endpoint , defaultPodResourcesTimeout , defaultPodResourcesMaxSize )
699
- framework .ExpectNoError (err )
699
+ framework .ExpectNoError (err , "GetV1Client() failed err: %v" , err )
700
700
defer conn .Close ()
701
701
702
702
podresourcesListTests (ctx , f , cli , nil )
@@ -708,10 +708,10 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
708
708
ginkgo .Context ("with CPU manager None policy" , func () {
709
709
ginkgo .It ("should return the expected responses" , func (ctx context.Context ) {
710
710
endpoint , err := util .LocalEndpoint (defaultPodResourcesPath , podresources .Socket )
711
- framework .ExpectNoError (err )
711
+ framework .ExpectNoError (err , "LocalEndpoint() failed err: %v" , err )
712
712
713
713
cli , conn , err := podresources .GetV1Client (endpoint , defaultPodResourcesTimeout , defaultPodResourcesMaxSize )
714
- framework .ExpectNoError (err )
714
+ framework .ExpectNoError (err , "GetV1Client() failed err: %v" , err )
715
715
defer conn .Close ()
716
716
717
717
// intentionally passing empty cpuset instead of onlineCPUs because with none policy
@@ -730,10 +730,10 @@ var _ = SIGDescribe("POD Resources [Serial] [Feature:PodResources][NodeFeature:P
730
730
731
731
ginkgo .It ("should return the expected error with the feature gate disabled" , func (ctx context.Context ) {
732
732
endpoint , err := util .LocalEndpoint (defaultPodResourcesPath , podresources .Socket )
733
- framework .ExpectNoError (err )
733
+ framework .ExpectNoError (err , "LocalEndpoint() failed err: %v" , err )
734
734
735
735
cli , conn , err := podresources .GetV1Client (endpoint , defaultPodResourcesTimeout , defaultPodResourcesMaxSize )
736
- framework .ExpectNoError (err )
736
+ framework .ExpectNoError (err , "GetV1Client() failed err: %v" , err )
737
737
defer conn .Close ()
738
738
739
739
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
776
776
waitForTopologyUnawareResources (ctx , f )
777
777
778
778
endpoint , err := util .LocalEndpoint (defaultPodResourcesPath , podresources .Socket )
779
- framework .ExpectNoError (err )
779
+ framework .ExpectNoError (err , "LocalEndpoint() failed err: %v" , err )
780
780
781
781
cli , conn , err := podresources .GetV1Client (endpoint , defaultPodResourcesTimeout , defaultPodResourcesMaxSize )
782
- framework .ExpectNoError (err )
782
+ framework .ExpectNoError (err , "GetV1Client() failed err: %v" , err )
783
783
defer conn .Close ()
784
784
785
785
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
827
827
ginkgo .BeforeEach (func (ctx context.Context ) {
828
828
// ensure APIs have been called at least once
829
829
endpoint , err := util .LocalEndpoint (defaultPodResourcesPath , podresources .Socket )
830
- framework .ExpectNoError (err )
830
+ framework .ExpectNoError (err , "LocalEndpoint() failed err %v" , err )
831
831
832
832
cli , conn , err := podresources .GetV1Client (endpoint , defaultPodResourcesTimeout , defaultPodResourcesMaxSize )
833
- framework .ExpectNoError (err )
833
+ framework .ExpectNoError (err , "GetV1Client() failed err %v" , err )
834
834
defer conn .Close ()
835
835
836
836
_ , err = cli .List (ctx , & kubeletpodresourcesv1.ListPodResourcesRequest {})
837
- framework .ExpectNoError (err )
837
+ framework .ExpectNoError (err , "List() failed err %v" , err )
838
838
839
839
_ , err = cli .GetAllocatableResources (ctx , & kubeletpodresourcesv1.AllocatableResourcesRequest {})
840
- framework .ExpectNoError (err )
840
+ framework .ExpectNoError (err , "GetAllocatableResources() failed err %v" , err )
841
841
})
842
842
843
843
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
869
869
ginkgo .It ("should hit throttling when calling podresources List in a tight loop" , func (ctx context.Context ) {
870
870
// ensure APIs have been called at least once
871
871
endpoint , err := util .LocalEndpoint (defaultPodResourcesPath , podresources .Socket )
872
- framework .ExpectNoError (err )
872
+ framework .ExpectNoError (err , "LocalEndpoint() failed err %v" , err )
873
873
874
874
ginkgo .By ("Connecting to the kubelet endpoint" )
875
875
cli , conn , err := podresources .GetV1Client (endpoint , defaultPodResourcesTimeout , defaultPodResourcesMaxSize )
876
- framework .ExpectNoError (err )
876
+ framework .ExpectNoError (err , "GetV1Client() failed err %v" , err )
877
877
defer conn .Close ()
878
878
879
879
tries := podresourcesgrpc .DefaultQPS * 2 // This should also be greater than DefaultBurstTokens
@@ -935,7 +935,7 @@ func setupSampleDevicePluginOrFail(ctx context.Context, f *framework.Framework)
935
935
if err != nil {
936
936
framework .Logf ("Sample Device Pod %v took too long to enter running/ready: %v" , dp .Name , err )
937
937
}
938
- framework .ExpectNoError (err )
938
+ framework .ExpectNoError (err , "WaitForPodCondition() failed err: %v" , err )
939
939
940
940
return dpPod
941
941
}
@@ -948,7 +948,7 @@ func teardownSampleDevicePluginOrFail(ctx context.Context, f *framework.Framewor
948
948
ginkgo .By (fmt .Sprintf ("Delete sample device plugin pod %s/%s" , pod .Namespace , pod .Name ))
949
949
err := f .ClientSet .CoreV1 ().Pods (pod .Namespace ).Delete (ctx , pod .Name , deleteOptions )
950
950
951
- framework .ExpectNoError (err )
951
+ framework .ExpectNoError (err , "Failed to delete Pod %v in Namspace %v" , pod . Name , pod . Namespace )
952
952
waitForAllContainerRemoval (ctx , pod .Name , pod .Namespace )
953
953
}
954
954
0 commit comments