Skip to content

Commit ff5de42

Browse files
committed
UPSTREAM: 131518: Don't reinitialize test framework during each test case
1 parent 5c87558 commit ff5de42

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

test/e2e/common/node/pod_resize.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func offsetMemory(index int64, value string) string {
6868
return ptr.String()
6969
}
7070

71-
func doPodResizeTests() {
71+
func doPodResizeTests(f *framework.Framework) {
7272
type testCase struct {
7373
name string
7474
containers []e2epod.ResizableContainerInfo
@@ -1156,7 +1156,6 @@ func doPodResizeTests() {
11561156

11571157
for idx := range tests {
11581158
tc := tests[idx]
1159-
f := framework.NewDefaultFramework("pod-resize-tests")
11601159

11611160
ginkgo.It(tc.name, func(ctx context.Context) {
11621161
podClient := e2epod.NewPodClient(f)
@@ -1234,7 +1233,7 @@ func doPodResizeTests() {
12341233
}
12351234
}
12361235

1237-
func doPodResizeErrorTests() {
1236+
func doPodResizeErrorTests(f *framework.Framework) {
12381237

12391238
type testCase struct {
12401239
name string
@@ -1389,7 +1388,6 @@ func doPodResizeErrorTests() {
13891388

13901389
for idx := range tests {
13911390
tc := tests[idx]
1392-
f := framework.NewDefaultFramework("pod-resize-error-tests")
13931391

13941392
ginkgo.It(tc.name, func(ctx context.Context) {
13951393
podClient := e2epod.NewPodClient(f)
@@ -1452,6 +1450,6 @@ var _ = SIGDescribe("Pod InPlace Resize Container", framework.WithFeatureGate(fe
14521450
}
14531451
})
14541452

1455-
doPodResizeTests()
1456-
doPodResizeErrorTests()
1453+
doPodResizeTests(f)
1454+
doPodResizeErrorTests(f)
14571455
})

test/e2e/node/pod_resize.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
"github.com/onsi/gomega"
4040
)
4141

42-
func doPodResizeAdmissionPluginsTests() {
42+
func doPodResizeAdmissionPluginsTests(f *framework.Framework) {
4343
testcases := []struct {
4444
name string
4545
enableAdmissionPlugin func(ctx context.Context, f *framework.Framework)
@@ -118,8 +118,6 @@ func doPodResizeAdmissionPluginsTests() {
118118
}
119119

120120
for _, tc := range testcases {
121-
f := framework.NewDefaultFramework(tc.name)
122-
123121
ginkgo.It(tc.name, func(ctx context.Context) {
124122
containers := []e2epod.ResizableContainerInfo{
125123
{
@@ -458,7 +456,7 @@ var _ = SIGDescribe("Pod InPlace Resize Container", framework.WithFeatureGate(fe
458456
e2eskipper.Skipf("runtime does not support InPlacePodVerticalScaling -- skipping")
459457
}
460458
})
461-
doPodResizeAdmissionPluginsTests()
459+
doPodResizeAdmissionPluginsTests(f)
462460
})
463461

464462
func waitForResourceQuota(ctx context.Context, c clientset.Interface, ns, quotaName string) error {

0 commit comments

Comments
 (0)