Skip to content

Commit adabcc3

Browse files
authored
Merge pull request kubernetes#93212 from liggitt/gcepd-delete
Deflake GCEPD namespace deletion test
2 parents 37cb765 + 9d83ca4 commit adabcc3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/e2e/storage/persistent_volumes-gce.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package storage
1818

1919
import (
2020
"context"
21+
2122
"github.com/onsi/ginkgo"
2223
v1 "k8s.io/api/core/v1"
2324
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -151,14 +152,15 @@ var _ = utils.SIGDescribe("PersistentVolumes GCEPD", func() {
151152
})
152153

153154
// Test that a Pod and PVC attached to a GCEPD successfully unmounts and detaches when the encompassing Namespace is deleted.
154-
ginkgo.It("should test that deleting the Namespace of a PVC and Pod causes the successful detach of Persistent Disk [Flaky]", func() {
155+
ginkgo.It("should test that deleting the Namespace of a PVC and Pod causes the successful detach of Persistent Disk", func() {
155156

156157
ginkgo.By("Deleting the Namespace")
157158
err := c.CoreV1().Namespaces().Delete(context.TODO(), ns, metav1.DeleteOptions{})
158159
framework.ExpectNoError(err)
159160

160-
err = framework.WaitForNamespacesDeleted(c, []string{ns}, framework.DefaultNamespaceDeletionTimeout)
161-
framework.ExpectNoError(err)
161+
// issue deletes for the client pod and claim, accelerating namespace controller actions
162+
e2epod.DeletePodOrFail(c, clientPod.Namespace, clientPod.Name)
163+
framework.ExpectNoError(e2epv.DeletePersistentVolumeClaim(c, pvc.Name, ns), "Unable to delete PVC ", pvc.Name)
162164

163165
ginkgo.By("Verifying Persistent Disk detaches")
164166
framework.ExpectNoError(waitForPDDetach(diskName, node), "PD ", diskName, " did not detach")

0 commit comments

Comments
 (0)