Change:
<!-- Please only use this template for submitting reports about failing tests in Kubernetes CI jobs --Which jobs are failing: ci-kubernetes-e2e-gci-gce Which test(s) are failing: I0221 20:48:18.462] [sig-storage] In-tree Volumes I0221 20:48:18.462] [[0m I0221 20:48:18.462] [Driver: gcepd] I0221 20:48:18.462] [[0m I0221 20:48:18.462] [Testpattern: Dynamic PV (filesystem volmode)] volumeMode I0221 20:48:18.463] [[0m I0221 20:48:18.463] should create sc, pod, pv, and pvc, read/write to the pv, and delete all created resources Since when has it been failing: unsure Testgrid link: Reason for failure: From the logs, it looks like it's deleting both PVC and PV objects at the same time, which is not correct. I0221 20:48:18.460] Feb 21 20:48:09.866: INFO: Deleting PersistentVolumeClaim "pvc-cjv2l" I0221 20:48:18.460] Feb 21 20:48:09.923: INFO: Deleting PersistentVolume "pvc--3619-11e9-b923-" should be changed to only delete PVC and wait for PV to be deleted by the driver. Can it just call which does it correctly? Anything else we need to know:
cc
It has been like that already before my recent code refactoring: Therefore I have to defer to - I myself don't really know what this test does or why it was written like that.
/milestone v1.14 We're entering and this looks relevant to the 1.14 release. Please if I am incorrect
/priority critical-urgent

Discussion:
case testpatterns.DynamicPV: By("Deleting pvc") // We only delete the PVC so that PV (and disk) can be cleaned up by dynamic provisioner <del> if r.pv.Spec.PersistentVolumeReclaimPolicy != v1.PersistentVolumeReclaimDelete { </del> <ins> if r.pv != nil && r.pv.Spec.PersistentVolumeReclaimPolicy != v1.PersistentVolumeReclaimDelete { </ins> framework.Failf("Test framework does not currently support Dynamically Provisioned Persistent Volume %v specified with reclaim policy that isnt %v", r.pv.Name, v1.PersistentVolumeReclaimDelete) } <del> err := framework.DeletePersistentVolumeClaim(f.ClientSet, r.pvc.Name, f.Namespace.Name) framework.ExpectNoError(err, "Failed to delete PVC %v", r.pvc.Name) err = framework.WaitForPersistentVolumeDeleted(f.ClientSet, r.pv.Name, 5*time.Second, 5*time.Minute) framework.ExpectNoError(err, "Persistent Volume %v not deleted by dynamic provisioner", r.pv.Name) </del> <ins> if r.pvc != nil { err := framework.DeletePersistentVolumeClaim(f.ClientSet, r.pvc.Name, f.Namespace.Name) framework.ExpectNoError(err, "Failed to delete PVC %v", r.pvc.Name) if r.pv != nil { err = framework.WaitForPersistentVolumeDeleted(f.ClientSet, r.pv.Name, 5*time.Second, 5*time.Minute) framework.ExpectNoError(err, "Persistent Volume %v not deleted by dynamic provisioner", r.pv.Name) } } </ins> default: framework.Failf("Found PVC (%v) or PV (%v) but not running Preprovisioned or Dynamic test pattern", r.pvc, r.pv) }

"k8s.io/api/core/v1" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" <del> utilerrors "k8s.io/apimachinery/pkg/util/errors" </del> clientset "k8s.io/client-go/kubernetes" "k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/storage/testpatterns"

config      *PerTestConfig testCleanup func() <del> cs     clientset.Interface ns     *v1.Namespace sc     *storagev1.StorageClass pvc    *v1.PersistentVolumeClaim pv     *v1.PersistentVolume volume TestVolume </del> <ins> cs clientset.Interface ns *v1.Namespace // genericVolumeTestResource contains pv, pvc, sc, etc., owns cleaning that up genericVolumeTestResource </ins> } var ( dInfo = driver.GetDriverInfo()

volumeNodeAffinity *v1.VolumeNodeAffinity ) <ins> l.genericVolumeTestResource = genericVolumeTestResource{ driver:  driver, config:  l.config, pattern: pattern, } </ins> // Create volume for pre-provisioned volume tests l.volume = CreateVolume(driver, l.config, pattern.VolType)

} cleanup := func() { <del> if l.pv != nil || l.pvc != nil { By("Deleting pv and pvc") errs := framework.PVPVCCleanup(f.ClientSet, f.Namespace.Name, l.pv, l.pvc) if len(errs) > 0 { framework.Logf("Failed to delete PV and/or PVC: %v", utilerrors.NewAggregate(errs)) } l.pv = nil l.pvc = nil } if l.sc != nil { By("Deleting sc") deleteStorageClass(f.ClientSet, l.sc.Name) l.sc = nil } if l.volume != nil { l.volume.DeleteVolume() l.volume = nil } </del> <ins> l.cleanupResource() </ins> if l.testCleanup != nil { l.testCleanup()