Skip to content

Commit

Permalink
Increase wait timeout
Browse files Browse the repository at this point in the history
Signed-off-by: hossainemruz <[email protected]>
  • Loading branch information
hossainemruz committed Jun 4, 2020
1 parent 4342808 commit 54f87b7
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 36 deletions.
17 changes: 8 additions & 9 deletions test/e2e/framework/backup_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"strconv"
"strings"
"time"

"stash.appscode.dev/apimachinery/apis"
"stash.appscode.dev/apimachinery/apis/stash/v1alpha1"
Expand Down Expand Up @@ -89,8 +88,8 @@ func (f *Framework) EventuallyCronJobCreated(meta metav1.ObjectMeta) GomegaAsync
}
return false
},
time.Minute*2,
time.Second*5,
WaitTimeOut,
PullInterval,
)
}

Expand All @@ -107,8 +106,8 @@ func (f *Framework) EventuallyCronJobSuspended(meta metav1.ObjectMeta) GomegaAsy
}
return *cronJob.Spec.Suspend
},
time.Minute*2,
time.Second*5,
WaitTimeOut,
PullInterval,
)
}

Expand All @@ -121,8 +120,8 @@ func (f *Framework) EventuallyCronJobResumed(meta metav1.ObjectMeta) GomegaAsync
}
return !*cronJob.Spec.Suspend
},
time.Minute*2,
time.Second*5,
WaitTimeOut,
PullInterval,
)
}

Expand All @@ -135,8 +134,8 @@ func (f *Framework) EventuallyBackupConfigurationCreated(meta metav1.ObjectMeta)
}
return false
},
time.Minute*2,
time.Second*5,
WaitTimeOut,
PullInterval,
)
}

Expand Down
5 changes: 2 additions & 3 deletions test/e2e/framework/backup_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"fmt"
"strings"
"time"

"stash.appscode.dev/apimachinery/apis"
"stash.appscode.dev/apimachinery/apis/stash/v1beta1"
Expand Down Expand Up @@ -112,7 +111,7 @@ func (fi *Invocation) EventuallyBackupCount(invokerMeta metav1.ObjectMeta, invok
return 0
}
return count
}, 3*time.Minute, 5*time.Second)
}, WaitTimeOut, PullInterval)
}

func (fi *Invocation) GetSuccessfulBackupSessionCount(invokerMeta metav1.ObjectMeta, invokerKind string) (int64, error) {
Expand Down Expand Up @@ -146,5 +145,5 @@ func (fi *Invocation) EventuallyRunningBackupCompleted(invokerMeta metav1.Object
}
}
return true
}, 3*time.Minute, 5*time.Second)
}, WaitTimeOut, PullInterval)
}
9 changes: 4 additions & 5 deletions test/e2e/framework/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package framework

import (
"context"
"time"

"stash.appscode.dev/apimachinery/apis/stash/v1beta1"

Expand Down Expand Up @@ -57,8 +56,8 @@ func (f *Framework) EventuallyCondition(meta metav1.ObjectMeta, kind string, con
}
return cond.Status
},
5*time.Minute,
2*time.Second,
WaitTimeOut,
PullInterval,
)
}

Expand All @@ -83,7 +82,7 @@ func (f *Framework) EventuallyTargetCondition(meta metav1.ObjectMeta, target v1b
}
return kmapi.ConditionUnknown
},
5*time.Minute,
2*time.Second,
WaitTimeOut,
PullInterval,
)
}
5 changes: 2 additions & 3 deletions test/e2e/framework/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package framework
import (
"context"
"fmt"
"time"

"stash.appscode.dev/apimachinery/apis"

Expand Down Expand Up @@ -77,8 +76,8 @@ func (f *Framework) EventuallyDeployment(meta metav1.ObjectMeta) GomegaAsyncAsse
Expect(err).NotTo(HaveOccurred())
return obj
},
time.Minute*2,
time.Second*5,
WaitTimeOut,
PullInterval,
)
}

Expand Down
3 changes: 1 addition & 2 deletions test/e2e/framework/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"database/sql"
"fmt"
"time"

"stash.appscode.dev/apimachinery/apis"
"stash.appscode.dev/apimachinery/apis/stash/v1alpha1"
Expand Down Expand Up @@ -269,7 +268,7 @@ func (fi *Invocation) CreateMySQL(dpl *apps.Deployment) error {

func (fi *Invocation) EventuallyConnectWithMySQLServer(db *sql.DB) error {

return wait.PollImmediate(5*time.Second, 5*time.Minute, func() (bool, error) {
return wait.PollImmediate(PullInterval, WaitTimeOut, func() (bool, error) {
if err := db.Ping(); err != nil {
return false, nil // don't return error. we need to retry.
}
Expand Down
7 changes: 3 additions & 4 deletions test/e2e/framework/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"context"
"fmt"
"strings"
"time"

"github.com/appscode/go/crypto/rand"
. "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -216,8 +215,8 @@ func (f *Framework) EventuallyAllPodsAccessible(meta metav1.ObjectMeta) GomegaAs
}
return allPodAccessible
},
time.Minute*2,
time.Second*2,
WaitTimeOut,
PullInterval,
)
}

Expand All @@ -229,7 +228,7 @@ func (f *Framework) EventuallyPodAccessible(meta metav1.ObjectMeta) GomegaAsyncA
_, err = f.ExecOnPod(pod, "ls", "-R")
return err == nil

}, time.Minute*2, time.Second*2)
}, WaitTimeOut, PullInterval)
}

func (fi *Invocation) DeployPod(pvcName string) (*core.Pod, error) {
Expand Down
5 changes: 2 additions & 3 deletions test/e2e/framework/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"fmt"
"strconv"
"time"

"stash.appscode.dev/apimachinery/apis"
api "stash.appscode.dev/apimachinery/apis/stash/v1alpha1"
Expand Down Expand Up @@ -52,8 +51,8 @@ func (f *Framework) EventuallyRepositoryCreated(meta metav1.ObjectMeta) GomegaAs
}
return false
},
time.Minute*2,
time.Second*5,
WaitTimeOut,
PullInterval,
)
}

Expand Down
11 changes: 4 additions & 7 deletions test/e2e/framework/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@ var (
)

const (
TestSoucreDemoDataPath = "/data/stash-test/demo-data"
TestSourceDataDir1 = "/source/data/dir-1"
TestSourceDataDir2 = "/source/data/dir-2"
PullInterval = time.Second * 2
WaitTimeOut = time.Minute * 3
WaitTimeOut = time.Minute * 10
TaskPVCBackup = "pvc-backup"
TaskPVCRestore = "pvc-restore"
TestSourceDataTargetPath = "/source/data"
Expand Down Expand Up @@ -399,8 +396,8 @@ func (f *Framework) EventuallyAnnotationsFound(expectedAnnotations map[string]st
}
return true
},
time.Minute*2,
time.Second*5,
WaitTimeOut,
PullInterval,
)
}

Expand Down Expand Up @@ -532,7 +529,7 @@ func (f *Framework) EventuallyEventWritten(involvedObjectMeta metav1.ObjectMeta,
}
}
return false
}, time.Minute*2, time.Second*5)
}, WaitTimeOut, PullInterval)
}

func HasFSGroup(sc *core.PodSecurityContext) bool {
Expand Down

0 comments on commit 54f87b7

Please sign in to comment.