Increase timeout for testing PD create/delete.

fix #26795 for releasev1.1
This commit is contained in:
Jing Xu
2016-06-14 14:46:47 -07:00
parent afedd3d34d
commit d8eedd5404

View File

@@ -46,6 +46,8 @@ const (
gcePDDetachPollTime = 10 * time.Second gcePDDetachPollTime = 10 * time.Second
nodeStatusTimeout = 1 * time.Minute nodeStatusTimeout = 1 * time.Minute
nodeStatusPollTime = 1 * time.Second nodeStatusPollTime = 1 * time.Second
gcePDRetryTimeout = 5 * time.Minute
gcePDRetryPollTime = 5 * time.Second
) )
var _ = framework.KubeDescribe("Pod Disks", func() { var _ = framework.KubeDescribe("Pod Disks", func() {
@@ -286,7 +288,7 @@ var _ = framework.KubeDescribe("Pod Disks", func() {
func createPDWithRetry() (string, error) { func createPDWithRetry() (string, error) {
newDiskName := "" newDiskName := ""
var err error var err error
for start := time.Now(); time.Since(start) < 180*time.Second; time.Sleep(5 * time.Second) { for start := time.Now(); time.Since(start) < gcePDRetryTimeout; time.Sleep(gcePDRetryPollTime) {
if newDiskName, err = createPD(); err != nil { if newDiskName, err = createPD(); err != nil {
framework.Logf("Couldn't create a new PD. Sleeping 5 seconds (%v)", err) framework.Logf("Couldn't create a new PD. Sleeping 5 seconds (%v)", err)
continue continue
@@ -299,7 +301,7 @@ func createPDWithRetry() (string, error) {
func deletePDWithRetry(diskName string) { func deletePDWithRetry(diskName string) {
var err error var err error
for start := time.Now(); time.Since(start) < 180*time.Second; time.Sleep(5 * time.Second) { for start := time.Now(); time.Since(start) < gcePDRetryTimeout; time.Sleep(gcePDRetryPollTime) {
if err = deletePD(diskName); err != nil { if err = deletePD(diskName); err != nil {
framework.Logf("Couldn't delete PD %q. Sleeping 5 seconds (%v)", diskName, err) framework.Logf("Couldn't delete PD %q. Sleeping 5 seconds (%v)", diskName, err)
continue continue