From a8e742f462f993290b574ef6f2c08200bf18cbfb Mon Sep 17 00:00:00 2001 From: David Oppenheimer Date: Fri, 22 Jan 2016 15:32:20 -0800 Subject: [PATCH] Add time logging to runReplicationControllerTest to help debug timeouts in the future. --- cmd/integration/integration.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/integration/integration.go b/cmd/integration/integration.go index f7d1cd8099..d9f29a6ae5 100644 --- a/cmd/integration/integration.go +++ b/cmd/integration/integration.go @@ -435,11 +435,14 @@ containers: } func runReplicationControllerTest(c *client.Client) { + t := time.Now() clientAPIVersion := c.APIVersion().String() data, err := ioutil.ReadFile("cmd/integration/" + clientAPIVersion + "-controller.json") if err != nil { glog.Fatalf("Unexpected error: %v", err) } + glog.Infof("Done reading config file, took %v", time.Since(t)) + t = time.Now() var controller api.ReplicationController if err := api.Scheme.DecodeInto(data, &controller); err != nil { glog.Fatalf("Unexpected error: %v", err) @@ -450,7 +453,8 @@ func runReplicationControllerTest(c *client.Client) { if err != nil { 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 // 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 { 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. // This involves 3 operations: @@ -469,7 +475,7 @@ func runReplicationControllerTest(c *client.Client) { 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) {