Skip to content

Commit e99fea7

Browse files
committed
deflake volume tests
1 parent a4b8a3b commit e99fea7

File tree

1 file changed

+1
-12
lines changed
  • test/e2e/storage/drivers

1 file changed

+1
-12
lines changed

test/e2e/storage/drivers/csi.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ func (h *hostpathCSIDriver) PrepareTest(ctx context.Context, f *framework.Framew
235235
// Create secondary namespace which will be used for creating driver
236236
driverNamespace := utils.CreateDriverNamespace(ctx, f)
237237
driverns := driverNamespace.Name
238-
testns := f.Namespace.Name
239238

240239
ginkgo.By(fmt.Sprintf("deploying %s driver", h.driverInfo.Name))
241240
cancelLogging := utils.StartPodLogs(ctx, f, driverNamespace)
@@ -328,7 +327,6 @@ func (h *hostpathCSIDriver) PrepareTest(ctx context.Context, f *framework.Framew
328327
cleanupFunc := generateDriverCleanupFunc(
329328
f,
330329
h.driverInfo.Name,
331-
testns,
332330
driverns,
333331
cancelLogging)
334332
ginkgo.DeferCleanup(cleanupFunc)
@@ -600,7 +598,6 @@ func (m *mockCSIDriver) PrepareTest(ctx context.Context, f *framework.Framework)
600598
// Create secondary namespace which will be used for creating driver
601599
m.driverNamespace = utils.CreateDriverNamespace(ctx, f)
602600
driverns := m.driverNamespace.Name
603-
testns := f.Namespace.Name
604601

605602
if m.embedded {
606603
ginkgo.By("deploying csi mock proxy")
@@ -762,7 +759,6 @@ func (m *mockCSIDriver) PrepareTest(ctx context.Context, f *framework.Framework)
762759
driverCleanupFunc := generateDriverCleanupFunc(
763760
f,
764761
"mock",
765-
testns,
766762
driverns,
767763
cancelLogging)
768764

@@ -942,7 +938,6 @@ func (g *gcePDCSIDriver) GetSnapshotClass(ctx context.Context, config *storagefr
942938
}
943939

944940
func (g *gcePDCSIDriver) PrepareTest(ctx context.Context, f *framework.Framework) *storageframework.PerTestConfig {
945-
testns := f.Namespace.Name
946941
cfg := &storageframework.PerTestConfig{
947942
Driver: g,
948943
Prefix: "gcepd",
@@ -1000,7 +995,6 @@ func (g *gcePDCSIDriver) PrepareTest(ctx context.Context, f *framework.Framework
1000995
cleanupFunc := generateDriverCleanupFunc(
1001996
f,
1002997
"gce-pd",
1003-
testns,
1004998
driverns,
1005999
cancelLogging)
10061000
ginkgo.DeferCleanup(cleanupFunc)
@@ -1073,17 +1067,12 @@ func tryFunc(f func()) error {
10731067

10741068
func generateDriverCleanupFunc(
10751069
f *framework.Framework,
1076-
driverName, testns, driverns string,
1070+
driverName, driverns string,
10771071
cancelLogging func()) func(ctx context.Context) {
10781072

10791073
// Cleanup CSI driver and namespaces. This function needs to be idempotent and can be
10801074
// concurrently called from defer (or AfterEach) and AfterSuite action hooks.
10811075
cleanupFunc := func(ctx context.Context) {
1082-
ginkgo.By(fmt.Sprintf("deleting the test namespace: %s", testns))
1083-
// Delete the primary namespace but it's okay to fail here because this namespace will
1084-
// also be deleted by framework.Aftereach hook
1085-
_ = tryFunc(func() { f.DeleteNamespace(ctx, testns) })
1086-
10871076
ginkgo.By(fmt.Sprintf("uninstalling csi %s driver", driverName))
10881077
_ = tryFunc(cancelLogging)
10891078

0 commit comments

Comments
 (0)