vmware-archive / kubernetes-archived

This repository is archived. Please file in-tree vSphere Cloud Provider issues at https://github.com/kubernetes/kubernetes/issues . CSI Driver for vSphere is available at https://github.com/kubernetes/cloud-provider-vsphere
Apache License 2.0
46 stars 31 forks source link

testCleanupVSpherePersistentVolumeReclaim() is failing to delete vmdk #472

Open divyenpatel opened 6 years ago

divyenpatel commented 6 years ago

Test is failing to delete VMDK on Kubernetes release 1.9

https://github.com/kubernetes/kubernetes/blob/master/test/e2e/storage/vsphere/pv_reclaimpolicy.go

Failure message

/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/storage/vsphere/pv_reclaimpolicy.go:60
Expected error:
    <task.Error>: {
        LocalizedMethodFault: {
            DynamicData: {},
            Fault: {
                VimFault: {
                    MethodFault: {FaultCause: nil, FaultMessage: nil},
                },
                File: "/vmfs/volumes/5a67a374-4ac1201b-ccb3-02000d99405c/kubevols/e2e-vmdk-1523336818363396884.vmdk",
            },
            LocalizedMessage: "Error caused by file /vmfs/volumes/5a67a374-4ac1201b-ccb3-02000d99405c/kubevols/e2e-vmdk-1523336818363396884.vmdk",
        },
    }
    Error caused by file /vmfs/volumes/5a67a374-4ac1201b-ccb3-02000d99405c/kubevols/e2e-vmdk-1523336818363396884.vmdk
not to have occurred
/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/storage/vsphere/pv_reclaimpolicy.go:226

Failure is in the cleanup. After deleting Pod, we are deleting disk. We get error while deleting vmdk. Probably disk is still attached. I guess we should modify the test to wait enough to allow detaching disk once pod is deleted, before deleting statically created vmdk.

Test log

[AfterEach] [sig-storage] persistentvolumereclaim:vsphere
  /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/storage/vsphere/pv_reclaimpolicy.go:60
STEP: running testCleanupVSpherePersistentVolumeReclaim
Apr  9 22:07:34.196: INFO: Failed to delete virtual disk. err: Error caused by file /vmfs/volumes/5a67a374-4ac1201b-ccb3-02000d99405c/kubevols/e2e-vmdk-1523336818363396884.vmdk
[AfterEach] [sig-storage] PersistentVolumes [Feature:ReclaimPolicy]
  /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:142

cc: @abrarshivani