mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Increase the timeout for integration tests.
This commit is contained in:
		@@ -73,6 +73,8 @@ var (
 | 
			
		||||
	fakeDocker1, fakeDocker2 dockertools.FakeDockerClient
 | 
			
		||||
	// Limit the number of concurrent tests.
 | 
			
		||||
	maxConcurrency int
 | 
			
		||||
 | 
			
		||||
	longTestTimeout = time.Second * 300
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type fakeKubeletClient struct{}
 | 
			
		||||
@@ -410,7 +412,7 @@ containers:
 | 
			
		||||
			// Wait for the mirror pod to be created.
 | 
			
		||||
			podName := fmt.Sprintf("%s-localhost", desc)
 | 
			
		||||
			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 {
 | 
			
		||||
				if pods, err := c.Pods(namespace).List(labels.Everything(), fields.Everything()); err == nil {
 | 
			
		||||
					for _, pod := range pods.Items {
 | 
			
		||||
@@ -421,13 +423,13 @@ containers:
 | 
			
		||||
			}
 | 
			
		||||
			// Delete the mirror pod, and wait for it to be recreated.
 | 
			
		||||
			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 {
 | 
			
		||||
				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.
 | 
			
		||||
			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 {
 | 
			
		||||
				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
 | 
			
		||||
	// 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.
 | 
			
		||||
	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)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -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
 | 
			
		||||
	//  - We need to be able to query the kubelet on that minion for information about the pod
 | 
			
		||||
	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)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -798,7 +800,7 @@ func runServiceTest(client *client.Client) {
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		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)
 | 
			
		||||
	}
 | 
			
		||||
	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.
 | 
			
		||||
	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)
 | 
			
		||||
	}
 | 
			
		||||
	// A second service with the same port.
 | 
			
		||||
@@ -860,11 +862,11 @@ func runServiceTest(client *client.Client) {
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		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)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	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)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -907,7 +909,7 @@ func runSchedulerNoPhantomPodsTest(client *client.Client) {
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		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)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -916,7 +918,7 @@ func runSchedulerNoPhantomPodsTest(client *client.Client) {
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		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)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -932,7 +934,7 @@ func runSchedulerNoPhantomPodsTest(client *client.Client) {
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		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 {
 | 
			
		||||
			glog.Fatalf("FAILED: 'phantom.bar' was never deleted: %#v", pod)
 | 
			
		||||
		} else {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user