e2e: use Ginkgo context

All code must use the context from Ginkgo when doing API calls or polling for a
change, otherwise the code would not return immediately when the test gets
aborted.
This commit is contained in:
Patrick Ohly
2022-12-12 10:11:10 +01:00
parent bf1d1dfd0f
commit 2f6c4f5eab
418 changed files with 11489 additions and 11369 deletions

View File

@@ -45,23 +45,23 @@ var _ = common.SIGDescribe("Loadbalancing: L7 Scalability", func() {
scaleFramework *scale.IngressScaleFramework
)
ginkgo.BeforeEach(func() {
ginkgo.BeforeEach(func(ctx context.Context) {
e2eskipper.SkipUnlessProviderIs("gce", "gke")
scaleFramework = scale.NewIngressScaleFramework(f.ClientSet, ns, framework.TestContext.CloudConfig)
if err := scaleFramework.PrepareScaleTest(); err != nil {
if err := scaleFramework.PrepareScaleTest(ctx); err != nil {
framework.Failf("Unexpected error while preparing ingress scale test: %v", err)
}
})
ginkgo.AfterEach(func() {
if errs := scaleFramework.CleanupScaleTest(); len(errs) != 0 {
ginkgo.AfterEach(func(ctx context.Context) {
if errs := scaleFramework.CleanupScaleTest(ctx); len(errs) != 0 {
framework.Failf("Unexpected error while cleaning up ingress scale test: %v", errs)
}
})
ginkgo.It("Creating and updating ingresses should happen promptly with small/medium/large amount of ingresses", func(ctx context.Context) {
if errs := scaleFramework.RunScaleTest(); len(errs) != 0 {
if errs := scaleFramework.RunScaleTest(ctx); len(errs) != 0 {
framework.Failf("Unexpected error while running ingress scale test: %v", errs)
}