Improve the wait.Poll GoDoc and api

Add more tests, and switch to timeouts instead of cycles.
Deflake TestPoller
This commit is contained in:
Clayton Coleman
2014-08-22 11:36:01 -04:00
parent e0bf338cc5
commit 286c3c543c
4 changed files with 78 additions and 16 deletions

View File

@@ -170,7 +170,7 @@ func runReplicationControllerTest(c *client.Client) {
glog.Infof("Done creating replication controllers")
// Give the controllers some time to actually create the pods
if err := wait.Poll(time.Second, 10, c.ControllerHasDesiredReplicas(controllerRequest)); err != nil {
if err := wait.Poll(time.Second, time.Second*10, c.ControllerHasDesiredReplicas(controllerRequest)); err != nil {
glog.Fatalf("FAILED: pods never created %v", err)
}
@@ -179,7 +179,7 @@ func runReplicationControllerTest(c *client.Client) {
if err != nil {
glog.Fatalf("FAILED: unable to get pods to list: %v", err)
}
if err := wait.Poll(time.Second, 10, podsOnMinions(c, pods)); err != nil {
if err := wait.Poll(time.Second, time.Second*10, podsOnMinions(c, pods)); err != nil {
glog.Fatalf("FAILED: pods never started running %v", err)
}