Fix resize_nodes.go test.

This commit is contained in:
Wojciech Tyczynski 2015-11-30 14:36:11 +01:00
parent c1af9dcb7f
commit 0773eb034c
2 changed files with 7 additions and 2 deletions

View File

@ -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,
},
},
},

View File

@ -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)