Merge pull request #14681 from brendandburns/fix2

Increase the timeout for integration tests.
pull/6/head
Brendan Burns 2015-09-29 19:27:58 -07:00
commit a227cce20a
1 changed files with 14 additions and 12 deletions

View File

@ -73,6 +73,8 @@ var (
fakeDocker1, fakeDocker2 dockertools.FakeDockerClient fakeDocker1, fakeDocker2 dockertools.FakeDockerClient
// Limit the number of concurrent tests. // Limit the number of concurrent tests.
maxConcurrency int maxConcurrency int
longTestTimeout = time.Second * 300
) )
type fakeKubeletClient struct{} type fakeKubeletClient struct{}
@ -410,7 +412,7 @@ containers:
// Wait for the mirror pod to be created. // Wait for the mirror pod to be created.
podName := fmt.Sprintf("%s-localhost", desc) podName := fmt.Sprintf("%s-localhost", desc)
namespace := kubelet.NamespaceDefault namespace := kubelet.NamespaceDefault
if err := wait.Poll(time.Second, time.Minute*2, if err := wait.Poll(time.Second, longTestTimeout,
podRunning(c, namespace, podName)); err != nil { podRunning(c, namespace, podName)); err != nil {
if pods, err := c.Pods(namespace).List(labels.Everything(), fields.Everything()); err == nil { if pods, err := c.Pods(namespace).List(labels.Everything(), fields.Everything()); err == nil {
for _, pod := range pods.Items { for _, pod := range pods.Items {
@ -421,13 +423,13 @@ containers:
} }
// Delete the mirror pod, and wait for it to be recreated. // Delete the mirror pod, and wait for it to be recreated.
c.Pods(namespace).Delete(podName, nil) c.Pods(namespace).Delete(podName, nil)
if err = wait.Poll(time.Second, time.Minute*1, if err = wait.Poll(time.Second, longTestTimeout,
podRunning(c, namespace, podName)); err != nil { podRunning(c, namespace, podName)); err != nil {
glog.Fatalf("%s FAILED: mirror pod has not been re-created or is not running: %v", desc, err) glog.Fatalf("%s FAILED: mirror pod has not been re-created or is not running: %v", desc, err)
} }
// Remove the manifest file, and wait for the mirror pod to be deleted. // Remove the manifest file, and wait for the mirror pod to be deleted.
os.Remove(manifestFile.Name()) os.Remove(manifestFile.Name())
if err = wait.Poll(time.Second, time.Minute*1, if err = wait.Poll(time.Second, longTestTimeout,
podNotFound(c, namespace, podName)); err != nil { podNotFound(c, namespace, podName)); err != nil {
glog.Fatalf("%s FAILED: mirror pod has not been deleted: %v", desc, err) glog.Fatalf("%s FAILED: mirror pod has not been deleted: %v", desc, err)
} }
@ -456,7 +458,7 @@ func runReplicationControllerTest(c *client.Client) {
// In practice the controller doesn't need 60s to create a handful of pods, but network latencies on CI // In practice the controller doesn't need 60s to create a handful of pods, but network latencies on CI
// systems have been observed to vary unpredictably, so give the controller enough time to create pods. // systems have been observed to vary unpredictably, so give the controller enough time to create pods.
// Our e2e scalability tests will catch controllers that are *actually* slow. // Our e2e scalability tests will catch controllers that are *actually* slow.
if err := wait.Poll(time.Second, time.Second*60, client.ControllerHasDesiredReplicas(c, updated)); err != nil { if err := wait.Poll(time.Second, longTestTimeout, client.ControllerHasDesiredReplicas(c, updated)); err != nil {
glog.Fatalf("FAILED: pods never created %v", err) glog.Fatalf("FAILED: pods never created %v", err)
} }
@ -466,7 +468,7 @@ func runReplicationControllerTest(c *client.Client) {
// - The assignment must reflect in a `List` operation against the apiserver, for labels matching the selector // - The assignment must reflect in a `List` operation against the apiserver, for labels matching the selector
// - We need to be able to query the kubelet on that minion for information about the pod // - We need to be able to query the kubelet on that minion for information about the pod
if err := wait.Poll( if err := wait.Poll(
time.Second, time.Second*30, podsOnMinions(c, "test", labels.Set(updated.Spec.Selector).AsSelector())); err != nil { time.Second, longTestTimeout, podsOnMinions(c, "test", labels.Set(updated.Spec.Selector).AsSelector())); err != nil {
glog.Fatalf("FAILED: pods never started running %v", err) glog.Fatalf("FAILED: pods never started running %v", err)
} }
@ -798,7 +800,7 @@ func runServiceTest(client *client.Client) {
if err != nil { if err != nil {
glog.Fatalf("Failed to create pod: %v, %v", pod, err) glog.Fatalf("Failed to create pod: %v, %v", pod, err)
} }
if err := wait.Poll(time.Second, time.Second*20, podExists(client, pod.Namespace, pod.Name)); err != nil { if err := wait.Poll(time.Second, longTestTimeout, podExists(client, pod.Namespace, pod.Name)); err != nil {
glog.Fatalf("FAILED: pod never started running %v", err) glog.Fatalf("FAILED: pod never started running %v", err)
} }
svc1 := &api.Service{ svc1 := &api.Service{
@ -839,7 +841,7 @@ func runServiceTest(client *client.Client) {
} }
// TODO Reduce the timeouts in this test when endpoints controller is sped up. See #6045. // TODO Reduce the timeouts in this test when endpoints controller is sped up. See #6045.
if err := wait.Poll(time.Second, time.Second*60, endpointsSet(client, svc1.Namespace, svc1.Name, 1)); err != nil { if err := wait.Poll(time.Second, longTestTimeout, endpointsSet(client, svc1.Namespace, svc1.Name, 1)); err != nil {
glog.Fatalf("FAILED: unexpected endpoints: %v", err) glog.Fatalf("FAILED: unexpected endpoints: %v", err)
} }
// A second service with the same port. // A second service with the same port.
@ -860,11 +862,11 @@ func runServiceTest(client *client.Client) {
if err != nil { if err != nil {
glog.Fatalf("Failed to create service: %v, %v", svc2, err) glog.Fatalf("Failed to create service: %v, %v", svc2, err)
} }
if err := wait.Poll(time.Second, time.Second*60, endpointsSet(client, svc2.Namespace, svc2.Name, 1)); err != nil { if err := wait.Poll(time.Second, longTestTimeout, endpointsSet(client, svc2.Namespace, svc2.Name, 1)); err != nil {
glog.Fatalf("FAILED: unexpected endpoints: %v", err) glog.Fatalf("FAILED: unexpected endpoints: %v", err)
} }
if err := wait.Poll(time.Second, time.Second*60, endpointsSet(client, svc3.Namespace, svc3.Name, 0)); err != nil { if err := wait.Poll(time.Second, longTestTimeout, endpointsSet(client, svc3.Namespace, svc3.Name, 0)); err != nil {
glog.Fatalf("FAILED: service in other namespace should have no endpoints: %v", err) glog.Fatalf("FAILED: service in other namespace should have no endpoints: %v", err)
} }
@ -907,7 +909,7 @@ func runSchedulerNoPhantomPodsTest(client *client.Client) {
if err != nil { if err != nil {
glog.Fatalf("Failed to create pod: %v, %v", pod, err) glog.Fatalf("Failed to create pod: %v, %v", pod, err)
} }
if err := wait.Poll(time.Second, time.Second*30, podRunning(client, foo.Namespace, foo.Name)); err != nil { if err := wait.Poll(time.Second, longTestTimeout, podRunning(client, foo.Namespace, foo.Name)); err != nil {
glog.Fatalf("FAILED: pod never started running %v", err) glog.Fatalf("FAILED: pod never started running %v", err)
} }
@ -916,7 +918,7 @@ func runSchedulerNoPhantomPodsTest(client *client.Client) {
if err != nil { if err != nil {
glog.Fatalf("Failed to create pod: %v, %v", pod, err) glog.Fatalf("Failed to create pod: %v, %v", pod, err)
} }
if err := wait.Poll(time.Second, time.Second*30, podRunning(client, bar.Namespace, bar.Name)); err != nil { if err := wait.Poll(time.Second, longTestTimeout, podRunning(client, bar.Namespace, bar.Name)); err != nil {
glog.Fatalf("FAILED: pod never started running %v", err) glog.Fatalf("FAILED: pod never started running %v", err)
} }
@ -932,7 +934,7 @@ func runSchedulerNoPhantomPodsTest(client *client.Client) {
if err != nil { if err != nil {
glog.Fatalf("Failed to create pod: %v, %v", pod, err) glog.Fatalf("Failed to create pod: %v, %v", pod, err)
} }
if err := wait.Poll(time.Second, time.Second*60, podRunning(client, baz.Namespace, baz.Name)); err != nil { if err := wait.Poll(time.Second, longTestTimeout, podRunning(client, baz.Namespace, baz.Name)); err != nil {
if pod, perr := client.Pods(api.NamespaceDefault).Get("phantom.bar"); perr == nil { if pod, perr := client.Pods(api.NamespaceDefault).Get("phantom.bar"); perr == nil {
glog.Fatalf("FAILED: 'phantom.bar' was never deleted: %#v", pod) glog.Fatalf("FAILED: 'phantom.bar' was never deleted: %#v", pod)
} else { } else {