mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
e2e: add new custom timeout value for slow PV deletion
This commit is contained in:
parent
c82626f96f
commit
c28dba5494
@ -30,6 +30,7 @@ const (
|
|||||||
pvReclaimTimeout = 3 * time.Minute
|
pvReclaimTimeout = 3 * time.Minute
|
||||||
pvBoundTimeout = 3 * time.Minute
|
pvBoundTimeout = 3 * time.Minute
|
||||||
pvDeleteTimeout = 3 * time.Minute
|
pvDeleteTimeout = 3 * time.Minute
|
||||||
|
pvDeleteSlowTimeout = 20 * time.Minute
|
||||||
snapshotCreateTimeout = 5 * time.Minute
|
snapshotCreateTimeout = 5 * time.Minute
|
||||||
snapshotDeleteTimeout = 5 * time.Minute
|
snapshotDeleteTimeout = 5 * time.Minute
|
||||||
)
|
)
|
||||||
@ -68,6 +69,9 @@ type TimeoutContext struct {
|
|||||||
// PVDelete is how long PVs have to become deleted.
|
// PVDelete is how long PVs have to become deleted.
|
||||||
PVDelete time.Duration
|
PVDelete time.Duration
|
||||||
|
|
||||||
|
// PVDeleteSlow is the same as PVDelete, but slower.
|
||||||
|
PVDeleteSlow time.Duration
|
||||||
|
|
||||||
// SnapshotCreate is how long for snapshot to create snapshotContent.
|
// SnapshotCreate is how long for snapshot to create snapshotContent.
|
||||||
SnapshotCreate time.Duration
|
SnapshotCreate time.Duration
|
||||||
|
|
||||||
@ -88,6 +92,7 @@ func NewTimeoutContextWithDefaults() *TimeoutContext {
|
|||||||
PVReclaim: pvReclaimTimeout,
|
PVReclaim: pvReclaimTimeout,
|
||||||
PVBound: pvBoundTimeout,
|
PVBound: pvBoundTimeout,
|
||||||
PVDelete: pvDeleteTimeout,
|
PVDelete: pvDeleteTimeout,
|
||||||
|
PVDeleteSlow: pvDeleteSlowTimeout,
|
||||||
SnapshotCreate: snapshotCreateTimeout,
|
SnapshotCreate: snapshotCreateTimeout,
|
||||||
SnapshotDelete: snapshotDeleteTimeout,
|
SnapshotDelete: snapshotDeleteTimeout,
|
||||||
}
|
}
|
||||||
|
@ -383,11 +383,11 @@ func (t StorageClassTest) TestDynamicProvisioning() *v1.PersistentVolume {
|
|||||||
// it's expected for the caller to do it.) Technically, the first few delete
|
// it's expected for the caller to do it.) Technically, the first few delete
|
||||||
// attempts may fail, as the volume is still attached to a node because
|
// attempts may fail, as the volume is still attached to a node because
|
||||||
// kubelet is slowly cleaning up the previous pod, however it should succeed
|
// kubelet is slowly cleaning up the previous pod, however it should succeed
|
||||||
// in a couple of minutes. Wait 20 minutes to recover from random cloud
|
// in a couple of minutes. Wait 20 minutes (or whatever custom value is specified in
|
||||||
// hiccups.
|
// t.Timeouts.PVDeleteSlow) to recover from random cloud hiccups.
|
||||||
if pv != nil && pv.Spec.PersistentVolumeReclaimPolicy == v1.PersistentVolumeReclaimDelete {
|
if pv != nil && pv.Spec.PersistentVolumeReclaimPolicy == v1.PersistentVolumeReclaimDelete {
|
||||||
ginkgo.By(fmt.Sprintf("deleting the claim's PV %q", pv.Name))
|
ginkgo.By(fmt.Sprintf("deleting the claim's PV %q", pv.Name))
|
||||||
framework.ExpectNoError(e2epv.WaitForPersistentVolumeDeleted(client, pv.Name, 5*time.Second, 20*time.Minute))
|
framework.ExpectNoError(e2epv.WaitForPersistentVolumeDeleted(client, pv.Name, 5*time.Second, t.Timeouts.PVDeleteSlow))
|
||||||
}
|
}
|
||||||
|
|
||||||
return pv
|
return pv
|
||||||
|
Loading…
Reference in New Issue
Block a user