remove TODO and use framework.SingleCallTimeout

This commit is contained in:
tanjunchen 2020-02-14 01:12:46 +08:00
parent 8ca96f3e07
commit efec7e64ce
7 changed files with 3 additions and 19 deletions

View File

@ -54,7 +54,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/util/wait"
utilyaml "k8s.io/apimachinery/pkg/util/yaml" utilyaml "k8s.io/apimachinery/pkg/util/yaml"
clientset "k8s.io/client-go/kubernetes" 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" "k8s.io/kubernetes/test/e2e/framework"
e2eservice "k8s.io/kubernetes/test/e2e/framework/service" e2eservice "k8s.io/kubernetes/test/e2e/framework/service"
"k8s.io/kubernetes/test/e2e/framework/testfiles" "k8s.io/kubernetes/test/e2e/framework/testfiles"
@ -113,11 +113,6 @@ const (
// poll is how often to Poll pods, nodes and claims. // poll is how often to Poll pods, nodes and claims.
poll = 2 * time.Second 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. // 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 // unschedulable, since the master doesn't run kube-proxy. Without
// kube-proxy NodePorts won't work. // kube-proxy NodePorts won't work.
var nodes *v1.NodeList 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{ nodes, err = client.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{FieldSelector: fields.Set{
"spec.unschedulable": "false", "spec.unschedulable": "false",
}.AsSelector().String()}) }.AsSelector().String()})

View File

@ -216,7 +216,7 @@ func getNodeRuntimeOperationErrorRate(c clientset.Interface, node string) (NodeR
// GetStatsSummary contacts kubelet for the container information. // GetStatsSummary contacts kubelet for the container information.
func GetStatsSummary(c clientset.Interface, nodeName string) (*kubeletstatsv1alpha1.Summary, error) { 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() defer cancel()
data, err := c.CoreV1().RESTClient().Get(). data, err := c.CoreV1().RESTClient().Get().

View File

@ -20,13 +20,6 @@ import (
"time" "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. // PodLatencyData encapsulates pod startup latency information.
type PodLatencyData struct { type PodLatencyData struct {
// Name of the pod // Name of the pod

View File

@ -41,7 +41,6 @@ const (
// singleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent // singleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent
// transient failures from failing tests. // 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 singleCallTimeout = 5 * time.Minute
// ssh port // ssh port

View File

@ -61,7 +61,6 @@ const (
// singleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent // singleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent
// transient failures from failing tests. // 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 singleCallTimeout = 5 * time.Minute
// Some pods can take much longer to get ready due to volume attach/detach latency. // Some pods can take much longer to get ready due to volume attach/detach latency.

View File

@ -46,7 +46,6 @@ const (
// singleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent // singleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent
// transient failures from failing tests. // 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 singleCallTimeout = 5 * time.Minute
) )

View File

@ -125,7 +125,6 @@ const (
// SingleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent // SingleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent
// transient failures from failing tests. // 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 SingleCallTimeout = 5 * time.Minute
// NodeReadyInitialTimeout is how long nodes have to be "ready" when a test begins. They should already // NodeReadyInitialTimeout is how long nodes have to be "ready" when a test begins. They should already