diff --git a/test/e2e/resize_nodes.go b/test/e2e/resize_nodes.go index d0bfe9bfadd..25383a07821 100644 --- a/test/e2e/resize_nodes.go +++ b/test/e2e/resize_nodes.go @@ -185,6 +185,7 @@ func rcByNamePort(name string, replicas int, image string, port int, labels map[ func rcByNameContainer(name string, replicas int, image string, labels map[string]string, c api.Container) *api.ReplicationController { // Add "name": name to the labels, overwriting if it exists. labels["name"] = name + gracePeriod := int64(0) return &api.ReplicationController{ TypeMeta: unversioned.TypeMeta{ Kind: "ReplicationController", @@ -203,7 +204,8 @@ func rcByNameContainer(name string, replicas int, image string, labels map[strin Labels: labels, }, Spec: api.PodSpec{ - Containers: []api.Container{c}, + Containers: []api.Container{c}, + TerminationGracePeriodSeconds: &gracePeriod, }, }, }, diff --git a/test/e2e/util.go b/test/e2e/util.go index 49a9696426a..ecebb6463c7 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -768,7 +768,10 @@ func waitForPodToDisappear(c *client.Client, ns, podName string, label labels.Se // In case of failure or too long waiting time, an error is returned. func waitForRCPodToDisappear(c *client.Client, ns, rcName, podName string) error { label := labels.SelectorFromSet(labels.Set(map[string]string{"name": rcName})) - return waitForPodToDisappear(c, ns, podName, label, 20*time.Second, 5*time.Minute) + // NodeController evicts pod after 5 minutes, so we need timeout greater than that. + // Additionally, there can be non-zero grace period, so we are setting 10 minutes + // to be on the safe size. + return waitForPodToDisappear(c, ns, podName, label, 20*time.Second, 10*time.Minute) } // waitForService waits until the service appears (exist == true), or disappears (exist == false)