Change:
Currently the density tests are ok if all the pods come up eventually. We should verify there are no failure/error events while the pods are coming up. This could indicate issues dealing with the number of pods and should be investigated.
has been merged, and there's already an issue filed for followup actions, so I think we can close this.

Discussion:
"github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/client" <ins> "github.com/GoogleCloudPlatform/kubernetes/pkg/client/cache" "github.com/GoogleCloudPlatform/kubernetes/pkg/controller/framework" </ins> "github.com/GoogleCloudPlatform/kubernetes/pkg/fields" "github.com/GoogleCloudPlatform/kubernetes/pkg/labels" <ins> "github.com/GoogleCloudPlatform/kubernetes/pkg/runtime" </ins> "github.com/GoogleCloudPlatform/kubernetes/pkg/util" "github.com/GoogleCloudPlatform/kubernetes/pkg/util/wait" <ins> "github.com/GoogleCloudPlatform/kubernetes/pkg/watch" </ins> "github.com/golang/glog" . "github.com/onsi/ginkgo"

} // Launch a Replication Controller and wait for all pods it spawns <del> // to become running </del> <ins> // to become running.  The controller will need to be cleaned up external // to this method </ins> func RunRC(c *client.Client, name string, ns, image string, replicas int) { defer GinkgoRecover()

current := 0 same := 0 <del> defer func() { By("Cleaning up the replication controller") err := DeleteRC(c, ns, name) Expect(err).NotTo(HaveOccurred()) }() </del> By(fmt.Sprintf("Creating replication controller %s", name)) _, err := c.ReplicationControllers(ns).Create(&api.ReplicationController{ ObjectMeta: api.ObjectMeta{

} else if last == current { same++ } else if current < last { <del> Failf("Controller %s: Number of submitted pods dropped from %d to %d", last, current) </del> <ins> Failf("Controller %s: Number of submitted pods dropped from %d to %d", name, last, current) </ins> } if same >= failCount {

// during the test so clean it up here rc, err := c.ReplicationControllers(ns).Get(RCName) if err == nil && rc.Spec.Replicas != 0 { <del> DeleteRC(c, ns, RCName) </del> <ins> By("Cleaning up the replication controller") err := DeleteRC(c, ns, RCName) expectNoError(err) } // Clean up the namespace if a non-default one was used if ns != api.NamespaceDefault { By("Cleaning up the namespace") err := c.Namespaces().Delete(ns) expectNoError(err) </ins> } }) // Tests with "Skipped" substring in their name will be skipped when running // e2e test suite without --ginkgo.focus & --ginkgo.skip flags. type Density struct { skip          bool podsPerMinion int

} itArg := testArg It(name, func() { <ins> uuid := string(util.NewUUID()) </ins> totalPods := itArg.podsPerMinion * minionCount <del> RCName = "my-hostname-density" + strconv.Itoa(totalPods) + "-" + string(util.NewUUID()) </del> <ins> nameStr := strconv.Itoa(totalPods) + "-" + uuid ns = "e2e-density" + nameStr RCName = "my-hostname-density" + nameStr // Create a listener for events events := make([](*api.Event), 0) _, controller := framework.NewInformer( &cache.ListWatch{ ListFunc: func() (runtime.Object, error) { return c.Events(ns).List(labels.Everything(), fields.Everything()) }, WatchFunc: func(rv string) (watch.Interface, error) { return c.Events(ns).Watch(labels.Everything(), fields.Everything(), rv) }, }, &api.Event{}, time.Second*10, framework.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { events = append(events, obj.(*api.Event)) }, }, ) stop := make(chan struct{}) go controller.Run(stop) // Start the replication controller </ins> RunRC(c, RCName, ns, "gcr.io/google_containers/pause:go", totalPods) <ins> By("Waiting for all events to be recorded") last := -1 current := len(events) timeout := 10 * time.Minute for start := time.Now(); last < current && time.Since(start) < timeout; time.Sleep(10 * time.Second) { last = current current = len(events) } close(stop) if current != last { Logf("Warning: Not all events were recorded after waiting %.2f minutes", timeout.Minutes()) } Logf("Found %d events", current) // Verify there were no pod killings or failures By("Verifying there were no pod killings or failures") for _, e := range events { for _, s := range []string{"kill", "fail"} { Expect(e.Reason).NotTo(ContainSubstring(s), "event:' %s', reason: '%s', message: '%s', field path: '%s'", e, e.ObjectMeta.Name, e.Message, e.InvolvedObject.FieldPath) } } </ins> }) }

RunRC(c, name, ns, "gcr.io/google_containers/pause:go", n) podsLaunched += n glog.Info("Launched %v pods so far...", podsLaunched) <ins> err := DeleteRC(c, ns, name) expectNoError(err) </ins> } }() }