diff --git a/e2e/testcases/stress_test.go b/e2e/testcases/stress_test.go index 121223f501..a0917634c3 100644 --- a/e2e/testcases/stress_test.go +++ b/e2e/testcases/stress_test.go @@ -265,6 +265,8 @@ func TestStressLargeRequest(t *testing.T) { } } +// TestStress100CRDs would apply 100 CRDs and validate them as part of the stress test +// the same scenario is used for nomos CLI throttling validation func TestStress100CRDs(t *testing.T) { nt := nomostest.New(t, nomostesting.Reconciliation1, ntopts.Unstructured, ntopts.StressTest, ntopts.WithReconcileTimeout(configsync.DefaultReconcileTimeout)) @@ -288,6 +290,18 @@ func TestStress100CRDs(t *testing.T) { if err := nt.WatchForAllSyncs(); err != nil { nt.T.Fatal(err) } + + // Validate client-side throttling is disabled for nomos status + cmd := nt.Shell.Command("nomos", "status") + out, err := cmd.CombinedOutput() + if err != nil { + nt.T.Log(string(out)) + nt.T.Fatal(err) + } + + if strings.Contains(string(out), "due to client-side throttling") { + nt.T.Fatalf("Nomos status should not perform client-side throttling: %s", string(out)) + } } func fakeCRD(name, group string) *apiextensionsv1.CustomResourceDefinition { diff --git a/pkg/client/restconfig/config.go b/pkg/client/restconfig/config.go index b0673d2a51..b4634d7543 100644 --- a/pkg/client/restconfig/config.go +++ b/pkg/client/restconfig/config.go @@ -107,6 +107,8 @@ func AllKubectlConfigs(timeout time.Duration) (map[string]*rest.Config, error) { continue } + UpdateQPS(restCfg) + if timeout > 0 { restCfg.Timeout = timeout }