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:
@@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user