Skip to content

Commit

Permalink
Merge pull request #12631 from smarterclayton/timeout
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Jan 24, 2017
2 parents 08dd392 + 731bf45 commit 22d4240
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion test/extended/jobs/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var _ = g.Describe("[job][Conformance] openshift can execute jobs", func() {
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for a pod...")
podNames, err := exeutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), exeutil.ParseLabelsOrDie(labels), exeutil.CheckPodIsSucceededFn, 1, 2*time.Minute)
podNames, err := exeutil.WaitForPods(oc.KubeClient().Core().Pods(oc.Namespace()), exeutil.ParseLabelsOrDie(labels), exeutil.CheckPodIsSucceededFn, 1, 3*time.Minute)
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(len(podNames)).Should(o.Equal(1))

Expand Down
14 changes: 8 additions & 6 deletions test/extended/router/scoped.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
exutil "github.com/openshift/origin/test/extended/util"
)

const changeTimeoutSeconds = 3 * 60

var _ = g.Describe("[networking][router] openshift routers", func() {
defer g.GinkgoRecover()
var (
Expand All @@ -42,7 +44,7 @@ var _ = g.Describe("[networking][router] openshift routers", func() {
g.By(fmt.Sprintf("creating a scoped router from a config file %q", configPath))

var routerIP string
err := wait.Poll(time.Second, 2*time.Minute, func() (bool, error) {
err := wait.Poll(time.Second, changeTimeoutSeconds*time.Second, func() (bool, error) {
pod, err := oc.KubeFramework().ClientSet.Core().Pods(oc.KubeFramework().Namespace.Name).Get("scoped-router")
if err != nil {
return false, err
Expand All @@ -60,11 +62,11 @@ var _ = g.Describe("[networking][router] openshift routers", func() {

g.By("waiting for the healthz endpoint to respond")
healthzURI := fmt.Sprintf("http://%s:1936/healthz", routerIP)
err = waitForRouterOKResponseExec(ns, execPodName, healthzURI, routerIP, 60*2)
err = waitForRouterOKResponseExec(ns, execPodName, healthzURI, routerIP, changeTimeoutSeconds)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for the valid route to respond")
err = waitForRouterOKResponseExec(ns, execPodName, routerURL, "first.example.com", 60*2)
err = waitForRouterOKResponseExec(ns, execPodName, routerURL, "first.example.com", changeTimeoutSeconds)
o.Expect(err).NotTo(o.HaveOccurred())

for _, host := range []string{"second.example.com", "third.example.com"} {
Expand All @@ -83,7 +85,7 @@ var _ = g.Describe("[networking][router] openshift routers", func() {
g.By(fmt.Sprintf("creating a scoped router from a config file %q", configPath))

var routerIP string
err := wait.Poll(time.Second, 2*time.Minute, func() (bool, error) {
err := wait.Poll(time.Second, changeTimeoutSeconds*time.Second, func() (bool, error) {
pod, err := oc.KubeFramework().ClientSet.Core().Pods(ns).Get("router-override")
if err != nil {
return false, err
Expand All @@ -103,11 +105,11 @@ var _ = g.Describe("[networking][router] openshift routers", func() {

g.By("waiting for the healthz endpoint to respond")
healthzURI := fmt.Sprintf("http://%s:1936/healthz", routerIP)
err = waitForRouterOKResponseExec(ns, execPodName, healthzURI, routerIP, 60*2)
err = waitForRouterOKResponseExec(ns, execPodName, healthzURI, routerIP, changeTimeoutSeconds)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for the valid route to respond")
err = waitForRouterOKResponseExec(ns, execPodName, routerURL, fmt.Sprintf(pattern, "route-1", ns), 60*2)
err = waitForRouterOKResponseExec(ns, execPodName, routerURL, fmt.Sprintf(pattern, "route-1", ns), changeTimeoutSeconds)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("checking that the stored domain name does not match a route")
Expand Down
8 changes: 4 additions & 4 deletions test/extended/router/weighted.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var _ = g.Describe("[networking][router] weighted openshift router", func() {
g.By(fmt.Sprintf("creating a weighted router from a config file %q", configPath))

var routerIP string
err := wait.Poll(time.Second, 2*time.Minute, func() (bool, error) {
err := wait.Poll(time.Second, changeTimeoutSeconds*time.Second, func() (bool, error) {
pod, err := oc.KubeFramework().ClientSet.Core().Pods(oc.KubeFramework().Namespace.Name).Get("weighted-router")
if err != nil {
return false, err
Expand All @@ -62,22 +62,22 @@ var _ = g.Describe("[networking][router] weighted openshift router", func() {

g.By("waiting for the healthz endpoint to respond")
healthzURI := fmt.Sprintf("http://%s:1936/healthz", routerIP)
err = waitForRouterOKResponseExec(ns, execPodName, healthzURI, routerIP, 60*2)
err = waitForRouterOKResponseExec(ns, execPodName, healthzURI, routerIP, changeTimeoutSeconds)
o.Expect(err).NotTo(o.HaveOccurred())

host := "weighted.example.com"
times := 100
g.By(fmt.Sprintf("checking that %d requests go through successfully", times))
// wait for the request to stabilize
err = waitForRouterOKResponseExec(ns, execPodName, routerURL, "weighted.example.com", 60*2)
err = waitForRouterOKResponseExec(ns, execPodName, routerURL, "weighted.example.com", changeTimeoutSeconds)
o.Expect(err).NotTo(o.HaveOccurred())
// all requests should now succeed
err = expectRouteStatusCodeRepeatedExec(ns, execPodName, routerURL, "weighted.example.com", http.StatusOK, times)
o.Expect(err).NotTo(o.HaveOccurred())

g.By(fmt.Sprintf("checking that there are two weighted backends in the router stats"))
var trafficValues []string
err = wait.PollImmediate(100*time.Millisecond, 2*time.Minute, func() (bool, error) {
err = wait.PollImmediate(100*time.Millisecond, changeTimeoutSeconds*time.Second, func() (bool, error) {
statsURL := fmt.Sprintf("http://%s:1936/;csv", routerIP)
stats, err := getAuthenticatedRouteURLViaPod(ns, execPodName, statsURL, host, "admin", "password")
o.Expect(err).NotTo(o.HaveOccurred())
Expand Down

0 comments on commit 22d4240

Please sign in to comment.