Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
test: avoid throttling
Browse files Browse the repository at this point in the history
Enabling verbose logging showed that the initial cluster ready check
and pod logging were getting throttled by the default rate limiter in
the Kubernetes client. We probably don't want that and don't need to
worry about a runaway process or fairness, so we can avoid the
throttling and its associated log messages by setting a nop rate
limiter before creating the client.
  • Loading branch information
pohly authored and avalluri committed Sep 23, 2020
1 parent 582112a commit f9d8a0e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import (
"github.com/onsi/gomega"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clientset "k8s.io/client-go/kubernetes"
"k8s.io/client-go/util/flowcontrol"
"k8s.io/kubernetes/test/e2e/framework"
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
Expand All @@ -50,9 +52,16 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {

framework.Logf("checking config")

c, err := framework.LoadClientset()
// We don't want WaitForPodsRunningReady and pod logging to be throttled.
// Therefore we set a fake rate limiter which never throttles.
config, err := framework.LoadConfig()
if err != nil {
framework.Failf("Error loading client: %v", err)
framework.Failf("error creating client config: %v", err)
}
config.RateLimiter = flowcontrol.NewFakeAlwaysRateLimiter()
c, err := clientset.NewForConfig(config)
if err != nil {
framework.Failf("error creating client: %v", err)
}

if framework.TestContext.ReportDir != "" {
Expand Down

0 comments on commit f9d8a0e

Please sign in to comment.