mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #93212 from liggitt/gcepd-delete
Deflake GCEPD namespace deletion test
This commit is contained in:
		@@ -18,6 +18,7 @@ package storage
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"context"
 | 
						"context"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/onsi/ginkgo"
 | 
						"github.com/onsi/ginkgo"
 | 
				
			||||||
	v1 "k8s.io/api/core/v1"
 | 
						v1 "k8s.io/api/core/v1"
 | 
				
			||||||
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
						metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
				
			||||||
@@ -151,14 +152,15 @@ var _ = utils.SIGDescribe("PersistentVolumes GCEPD", func() {
 | 
				
			|||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Test that a Pod and PVC attached to a GCEPD successfully unmounts and detaches when the encompassing Namespace is deleted.
 | 
						// Test that a Pod and PVC attached to a GCEPD successfully unmounts and detaches when the encompassing Namespace is deleted.
 | 
				
			||||||
	ginkgo.It("should test that deleting the Namespace of a PVC and Pod causes the successful detach of Persistent Disk [Flaky]", func() {
 | 
						ginkgo.It("should test that deleting the Namespace of a PVC and Pod causes the successful detach of Persistent Disk", func() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ginkgo.By("Deleting the Namespace")
 | 
							ginkgo.By("Deleting the Namespace")
 | 
				
			||||||
		err := c.CoreV1().Namespaces().Delete(context.TODO(), ns, metav1.DeleteOptions{})
 | 
							err := c.CoreV1().Namespaces().Delete(context.TODO(), ns, metav1.DeleteOptions{})
 | 
				
			||||||
		framework.ExpectNoError(err)
 | 
							framework.ExpectNoError(err)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		err = framework.WaitForNamespacesDeleted(c, []string{ns}, framework.DefaultNamespaceDeletionTimeout)
 | 
							// issue deletes for the client pod and claim, accelerating namespace controller actions
 | 
				
			||||||
		framework.ExpectNoError(err)
 | 
							e2epod.DeletePodOrFail(c, clientPod.Namespace, clientPod.Name)
 | 
				
			||||||
 | 
							framework.ExpectNoError(e2epv.DeletePersistentVolumeClaim(c, pvc.Name, ns), "Unable to delete PVC ", pvc.Name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ginkgo.By("Verifying Persistent Disk detaches")
 | 
							ginkgo.By("Verifying Persistent Disk detaches")
 | 
				
			||||||
		framework.ExpectNoError(waitForPDDetach(diskName, node), "PD ", diskName, " did not detach")
 | 
							framework.ExpectNoError(waitForPDDetach(diskName, node), "PD ", diskName, " did not detach")
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user