Revert "improve e2e retry logic with standard wait.Poll()"

This commit is contained in:
Quinton Hoole
2015-05-19 11:17:32 -07:00
parent b963307496
commit 14665119b4
10 changed files with 119 additions and 123 deletions

View File

@@ -26,7 +26,6 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/wait"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@@ -150,14 +149,13 @@ func validateGuestbookApp(c *client.Client, ns string) {
// Returns whether received expected response from guestbook on time.
func waitForGuestbookResponse(c *client.Client, cmd, arg, expectedResponse string, timeout time.Duration, ns string) bool {
expectNoError(wait.Poll(5*time.Second, timeout, func() (bool, error) {
for start := time.Now(); time.Since(start) < timeout; time.Sleep(5 * time.Second) {
res, err := makeRequestToGuestbook(c, cmd, arg, ns)
if err == nil && res == expectedResponse {
return true, nil
return true
}
return false, nil
}))
return true
}
return false
}
func makeRequestToGuestbook(c *client.Client, cmd, value string, ns string) (string, error) {