Skip to content

Commit

Permalink
tenantrate: allow TestCloser to run on up to 180 cores machines
Browse files Browse the repository at this point in the history
Currently, `TestCloser` only runs as expected on machines
with <= 45 cores. When the number of cores is more than 45,
the initial `burst` value will make the initial `current` tokens
value in the token bucket high enough to allow the
request to acquire quota on the fast path instead of waiting.

This code change quadruples the number of cores on which this
test can run normally by quadrupling the request size.

Release note: None
Epic: none

Closes cockroachdb#96467
  • Loading branch information
healthy-pod committed Feb 7, 2023
1 parent b031933 commit 81a5b40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/tenantrate/limiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestCloser(t *testing.T) {
// First Wait call will not block.
require.NoError(t, limiter.Wait(ctx, tenantcostmodel.TestingRequestInfo(1, 1, 1)))
errCh := make(chan error, 1)
go func() { errCh <- limiter.Wait(ctx, tenantcostmodel.TestingRequestInfo(1, 1, 1<<31)) }()
go func() { errCh <- limiter.Wait(ctx, tenantcostmodel.TestingRequestInfo(1, 1, 1<<33)) }()
testutils.SucceedsSoon(t, func() error {
if timers := timeSource.Timers(); len(timers) != 1 {
return errors.Errorf("expected 1 timer, found %d", len(timers))
Expand Down

0 comments on commit 81a5b40

Please sign in to comment.