mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-02 22:33:52 +00:00
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:
@@ -19,6 +19,8 @@ limitations under the License.
|
||||
package init
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/onsi/ginkgo/v2"
|
||||
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
@@ -28,8 +30,8 @@ import (
|
||||
func init() {
|
||||
framework.NewFrameworkExtensions = append(framework.NewFrameworkExtensions,
|
||||
func(f *framework.Framework) {
|
||||
ginkgo.BeforeEach(func() {
|
||||
metrics := e2emetrics.GrabBeforeEach(f)
|
||||
ginkgo.BeforeEach(func(ctx context.Context) {
|
||||
metrics := e2emetrics.GrabBeforeEach(ctx, f)
|
||||
ginkgo.DeferCleanup(e2emetrics.GrabAfterEach, f, metrics)
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user