Merge pull request #20037 from davidopp/flake1

Add time logging to runReplicationControllerTest to help debug timeouts in the future
pull/6/head
David Oppenheimer 2016-01-22 22:10:24 -08:00
commit 2866ae7bca
1 changed files with 8 additions and 2 deletions

View File

@ -435,11 +435,14 @@ containers:
} }
func runReplicationControllerTest(c *client.Client) { func runReplicationControllerTest(c *client.Client) {
t := time.Now()
clientAPIVersion := c.APIVersion().String() clientAPIVersion := c.APIVersion().String()
data, err := ioutil.ReadFile("cmd/integration/" + clientAPIVersion + "-controller.json") data, err := ioutil.ReadFile("cmd/integration/" + clientAPIVersion + "-controller.json")
if err != nil { if err != nil {
glog.Fatalf("Unexpected error: %v", err) glog.Fatalf("Unexpected error: %v", err)
} }
glog.Infof("Done reading config file, took %v", time.Since(t))
t = time.Now()
var controller api.ReplicationController var controller api.ReplicationController
if err := api.Scheme.DecodeInto(data, &controller); err != nil { if err := api.Scheme.DecodeInto(data, &controller); err != nil {
glog.Fatalf("Unexpected error: %v", err) glog.Fatalf("Unexpected error: %v", err)
@ -450,7 +453,8 @@ func runReplicationControllerTest(c *client.Client) {
if err != nil { if err != nil {
glog.Fatalf("Unexpected error: %v", err) glog.Fatalf("Unexpected error: %v", err)
} }
glog.Infof("Done creating replication controllers") glog.Infof("Done creating replication controllers, took %v", time.Since(t))
t = time.Now()
// In practice the controller doesn't need 60s to create a handful of pods, but network latencies on CI // In practice the controller doesn't need 60s to create a handful of pods, but network latencies on CI
// systems have been observed to vary unpredictably, so give the controller enough time to create pods. // systems have been observed to vary unpredictably, so give the controller enough time to create pods.
@ -458,6 +462,8 @@ func runReplicationControllerTest(c *client.Client) {
if err := wait.Poll(time.Second, longTestTimeout, client.ControllerHasDesiredReplicas(c, updated)); err != nil { if err := wait.Poll(time.Second, longTestTimeout, client.ControllerHasDesiredReplicas(c, updated)); err != nil {
glog.Fatalf("FAILED: pods never created %v", err) glog.Fatalf("FAILED: pods never created %v", err)
} }
glog.Infof("Done creating replicas, took %v", time.Since(t))
t = time.Now()
// Poll till we can retrieve the status of all pods matching the given label selector from their nodes. // Poll till we can retrieve the status of all pods matching the given label selector from their nodes.
// This involves 3 operations: // This involves 3 operations:
@ -469,7 +475,7 @@ func runReplicationControllerTest(c *client.Client) {
glog.Fatalf("FAILED: pods never started running %v", err) glog.Fatalf("FAILED: pods never started running %v", err)
} }
glog.Infof("Pods created") glog.Infof("Pods verified on nodes, took %v", time.Since(t))
} }
func runAPIVersionsTest(c *client.Client) { func runAPIVersionsTest(c *client.Client) {