Skip to content

Commit

Permalink
Remove client-side throttling from nomos status (#853)
Browse files Browse the repository at this point in the history
  • Loading branch information
victorpras authored Sep 8, 2023
1 parent e6d99d3 commit 14c0312
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions e2e/testcases/stress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions pkg/client/restconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ func AllKubectlConfigs(timeout time.Duration) (map[string]*rest.Config, error) {
continue
}

UpdateQPS(restCfg)

if timeout > 0 {
restCfg.Timeout = timeout
}
Expand Down

0 comments on commit 14c0312

Please sign in to comment.