Change:
The desired behavior is: Create spec.Replica pods As pods keep coming down watch, update status.Replicas, so users have pseudo real-time feedback If during this time someone submits a new update to spec.Replicas that bumps up the generation, dont update status.Generation to match Update Generation when pending creates/deletes are observed Without the third check, we could confuse a client who quicky scales up/down into thinking the current is for their spec (because spec will match status, but we still have pending creates/deletes). Observed in: Where we see: Because kubectl rolling-update deleted the rc soon after creation.
See discussion in Un-assigning myself since immediate issue of test flake is solved, and we need to think through how we're going to expose generation.
Issues go stale after 30d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. Prevent issues from auto-closing with an comment. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale
Stale issues rot after 30d of inactivity. Mark the issue as fresh with . Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle rotten /remove-lifecycle stale
Rotten issues close after 30d of inactivity. Reopen the issue with . Mark the issue as fresh with . Send feedback to sig-testing, kubernetes/test-infra and/or . /close

Discussion:
return p, err } <ins> // WaitForRCToStabilize waits till the RC has a matching generation/replica count between spec and status. func WaitForRCToStabilize(c *client.Client, ns, name string, timeout time.Duration) error { options := api.ListOptions{FieldSelector: fields.Set{ "metadata.name":      name, "metadata.namespace": ns, }.AsSelector()} w, err := c.ReplicationControllers(ns).Watch(options) if err != nil { return err } _, err = watch.Until(timeout, w, func(event watch.Event) (bool, error) { switch event.Type { case watch.Deleted: return false, apierrs.NewNotFound(unversioned.GroupResource{Resource: "replicationcontrollers"}, "") } switch rc := event.Object.(type) { case *api.ReplicationController: if rc.Name == name && rc.Namespace == ns && rc.Generation <= rc.Status.ObservedGeneration && rc.Spec.Replicas == rc.Status.Replicas { return true, nil } Logf("Waiting for rc %s to stabilize, generation %v observed generation %v spec.replicas %d status.replicas %d", name, rc.Generation, rc.Status.ObservedGeneration, rc.Spec.Replicas, rc.Status.Replicas) } return false, nil }) return err } </ins> func WaitForPodToDisappear(c *client.Client, ns, podName string, label labels.Selector, interval, timeout time.Duration) error { return wait.PollImmediate(interval, timeout, func() (bool, error) { Logf("Waiting for pod %s to disappear", podName)

if containers == nil || len(containers) != 1 || containers[0].Image != nginxImage { framework.Failf("Failed creating rc %s for 1 pod with expected image %s", rcName, nginxImage) } <ins> framework.WaitForRCToStabilize(c, ns, rcName, framework.PodStartTimeout) </ins> By("rolling-update to same image controller") framework.RunKubectlOrDie("rolling-update", rcName, "--update-period=1s", "--image="+nginxImage, "--image-pull-policy="+string(api.PullIfNotPresent), nsFlag)