Merge pull request #366 from brendandburns/timeout

Add some more logging to better understand integration test timeouts.
This commit is contained in:
Tim Hockin 2014-07-07 16:45:43 -07:00
commit 28f7d60965

View File

@ -119,9 +119,12 @@ func runReplicationControllerTest(kubeClient *client.Client) {
glog.Fatalf("Unexpected error: %#v", err) glog.Fatalf("Unexpected error: %#v", err)
} }
glog.Infof("Creating replication controllers")
if _, err = kubeClient.CreateReplicationController(controllerRequest); err != nil { if _, err = kubeClient.CreateReplicationController(controllerRequest); err != nil {
glog.Fatalf("Unexpected error: %#v", err) glog.Fatalf("Unexpected error: %#v", err)
} }
glog.Infof("Done creating replication controllers")
// Give the controllers some time to actually create the pods // Give the controllers some time to actually create the pods
time.Sleep(time.Second * 10) time.Sleep(time.Second * 10)
@ -147,9 +150,9 @@ func runAtomicPutTest(c *client.Client) {
if err != nil { if err != nil {
glog.Fatalf("Failed creating atomicService: %v", err) glog.Fatalf("Failed creating atomicService: %v", err)
} }
glog.Info("Created atomicService")
testLabels := labels.Set{} testLabels := labels.Set{}
for i := 0; i < 26; i++ { for i := 0; i < 5; i++ {
// a: z, b: y, etc... // a: z, b: y, etc...
testLabels[string([]byte{byte('a' + i)})] = string([]byte{byte('z' - i)}) testLabels[string([]byte{byte('a' + i)})] = string([]byte{byte('z' - i)})
} }
@ -158,6 +161,7 @@ func runAtomicPutTest(c *client.Client) {
for label, value := range testLabels { for label, value := range testLabels {
go func(l, v string) { go func(l, v string) {
for { for {
glog.Infof("Starting to update (%s, %s)", l, v)
var tmpSvc api.Service var tmpSvc api.Service
err := c.Get().Path("services").Path(svc.ID).Do().Into(&tmpSvc) err := c.Get().Path("services").Path(svc.ID).Do().Into(&tmpSvc)
if err != nil { if err != nil {
@ -169,10 +173,12 @@ func runAtomicPutTest(c *client.Client) {
} else { } else {
tmpSvc.Selector[l] = v tmpSvc.Selector[l] = v
} }
glog.Infof("Posting update (%s, %s)", l, v)
err = c.Put().Path("services").Path(svc.ID).Body(&tmpSvc).Do().Error() err = c.Put().Path("services").Path(svc.ID).Body(&tmpSvc).Do().Error()
if err != nil { if err != nil {
if se, ok := err.(*client.StatusErr); ok { if se, ok := err.(*client.StatusErr); ok {
if se.Status.Code == http.StatusConflict { if se.Status.Code == http.StatusConflict {
glog.Infof("Conflict: (%s, %s)", l, v)
// This is what we expect. // This is what we expect.
continue continue
} }
@ -182,6 +188,7 @@ func runAtomicPutTest(c *client.Client) {
} }
break break
} }
glog.Infof("Done update (%s, %s)", l, v)
wg.Done() wg.Done()
}(label, value) }(label, value)
} }