From efec7e64ce0af0a3349f1b2e2d243d4e8e66c167 Mon Sep 17 00:00:00 2001 From: tanjunchen Date: Fri, 14 Feb 2020 01:12:46 +0800 Subject: [PATCH] remove TODO and use framework.SingleCallTimeout --- test/e2e/framework/ingress/ingress_utils.go | 9 ++------- test/e2e/framework/kubelet/stats.go | 2 +- test/e2e/framework/metrics/latencies.go | 7 ------- test/e2e/framework/node/resource.go | 1 - test/e2e/framework/pod/wait.go | 1 - test/e2e/framework/ssh/ssh.go | 1 - test/e2e/framework/util.go | 1 - 7 files changed, 3 insertions(+), 19 deletions(-) diff --git a/test/e2e/framework/ingress/ingress_utils.go b/test/e2e/framework/ingress/ingress_utils.go index ed7dd5c719f..6220a3416be 100644 --- a/test/e2e/framework/ingress/ingress_utils.go +++ b/test/e2e/framework/ingress/ingress_utils.go @@ -54,7 +54,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" utilyaml "k8s.io/apimachinery/pkg/util/yaml" clientset "k8s.io/client-go/kubernetes" - scheme "k8s.io/client-go/kubernetes/scheme" + "k8s.io/client-go/kubernetes/scheme" "k8s.io/kubernetes/test/e2e/framework" e2eservice "k8s.io/kubernetes/test/e2e/framework/service" "k8s.io/kubernetes/test/e2e/framework/testfiles" @@ -113,11 +113,6 @@ const ( // poll is how often to Poll pods, nodes and claims. poll = 2 * time.Second - - // singleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent - // transient failures from failing tests. - // TODO: client should not apply this timeout to Watch calls. Increased from 30s until that is fixed. - singleCallTimeout = 5 * time.Minute ) // TestLogger is an interface for log. @@ -876,7 +871,7 @@ func getPortURL(client clientset.Interface, ns, name string, svcPort int) (strin // unschedulable, since the master doesn't run kube-proxy. Without // kube-proxy NodePorts won't work. var nodes *v1.NodeList - if wait.PollImmediate(poll, singleCallTimeout, func() (bool, error) { + if wait.PollImmediate(poll, framework.SingleCallTimeout, func() (bool, error) { nodes, err = client.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{FieldSelector: fields.Set{ "spec.unschedulable": "false", }.AsSelector().String()}) diff --git a/test/e2e/framework/kubelet/stats.go b/test/e2e/framework/kubelet/stats.go index eb406629707..e89fbdab9d9 100644 --- a/test/e2e/framework/kubelet/stats.go +++ b/test/e2e/framework/kubelet/stats.go @@ -216,7 +216,7 @@ func getNodeRuntimeOperationErrorRate(c clientset.Interface, node string) (NodeR // GetStatsSummary contacts kubelet for the container information. func GetStatsSummary(c clientset.Interface, nodeName string) (*kubeletstatsv1alpha1.Summary, error) { - ctx, cancel := context.WithTimeout(context.Background(), e2emetrics.SingleCallTimeout) + ctx, cancel := context.WithTimeout(context.Background(), framework.SingleCallTimeout) defer cancel() data, err := c.CoreV1().RESTClient().Get(). diff --git a/test/e2e/framework/metrics/latencies.go b/test/e2e/framework/metrics/latencies.go index 20eca22845d..3f549d5dbd8 100644 --- a/test/e2e/framework/metrics/latencies.go +++ b/test/e2e/framework/metrics/latencies.go @@ -20,13 +20,6 @@ import ( "time" ) -const ( - // SingleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent - // transient failures from failing tests. - // TODO: client should not apply this timeout to Watch calls. Increased from 30s until that is fixed. - SingleCallTimeout = 5 * time.Minute -) - // PodLatencyData encapsulates pod startup latency information. type PodLatencyData struct { // Name of the pod diff --git a/test/e2e/framework/node/resource.go b/test/e2e/framework/node/resource.go index b42634f6820..cdd6655ba63 100644 --- a/test/e2e/framework/node/resource.go +++ b/test/e2e/framework/node/resource.go @@ -41,7 +41,6 @@ const ( // singleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent // transient failures from failing tests. - // TODO: client should not apply this timeout to Watch calls. Increased from 30s until that is fixed. singleCallTimeout = 5 * time.Minute // ssh port diff --git a/test/e2e/framework/pod/wait.go b/test/e2e/framework/pod/wait.go index 83a4a22cb1b..4d0053be876 100644 --- a/test/e2e/framework/pod/wait.go +++ b/test/e2e/framework/pod/wait.go @@ -61,7 +61,6 @@ const ( // singleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent // transient failures from failing tests. - // TODO: client should not apply this timeout to Watch calls. Increased from 30s until that is fixed. singleCallTimeout = 5 * time.Minute // Some pods can take much longer to get ready due to volume attach/detach latency. diff --git a/test/e2e/framework/ssh/ssh.go b/test/e2e/framework/ssh/ssh.go index a7372afa0e4..dbe3a10aef9 100644 --- a/test/e2e/framework/ssh/ssh.go +++ b/test/e2e/framework/ssh/ssh.go @@ -46,7 +46,6 @@ const ( // singleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent // transient failures from failing tests. - // TODO: client should not apply this timeout to Watch calls. Increased from 30s until that is fixed. singleCallTimeout = 5 * time.Minute ) diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 23edde4dcaf..e3441a6c229 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -125,7 +125,6 @@ const ( // SingleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent // transient failures from failing tests. - // TODO: client should not apply this timeout to Watch calls. Increased from 30s until that is fixed. SingleCallTimeout = 5 * time.Minute // NodeReadyInitialTimeout is how long nodes have to be "ready" when a test begins. They should already