diff --git a/internal/daemon/controller/testing.go b/internal/daemon/controller/testing.go index 8fb99e592..04431068e 100644 --- a/internal/daemon/controller/testing.go +++ b/internal/daemon/controller/testing.go @@ -495,6 +495,8 @@ type TestControllerOpts struct { // Toggle worker auth debugging WorkerAuthDebuggingEnabled *atomic.Bool + + DisableRateLimiting bool } func NewTestController(t testing.TB, opts *TestControllerOpts) *TestController { @@ -806,6 +808,10 @@ func TestControllerConfig(t testing.TB, ctx context.Context, tc *TestController, } } + if opts.DisableRateLimiting { + opts.Config.Controller.ApiRateLimitDisable = true + } + return &Config{ RawConfig: opts.Config, Server: tc.b, diff --git a/internal/tests/api/credentials/credentials_test.go b/internal/tests/api/credentials/credentials_test.go index 397eeed2e..e98f58725 100644 --- a/internal/tests/api/credentials/credentials_test.go +++ b/internal/tests/api/credentials/credentials_test.go @@ -415,7 +415,13 @@ func TestUpdateAfterKeyRotation(t *testing.T) { // This prevents us from running tests in parallel. tg.SetupSuiteTargetFilters(t) - tc := controller.NewTestController(t, &controller.TestControllerOpts{SchedulerRunJobInterval: 100 * time.Millisecond}) + tc := controller.NewTestController( + t, + &controller.TestControllerOpts{ + SchedulerRunJobInterval: 100 * time.Millisecond, + DisableRateLimiting: true, + }, + ) ctx := tc.Context() client := tc.Client() token := tc.Token()