From e59cbad8a82526c5269b21aae31725c9a014ea71 Mon Sep 17 00:00:00 2001 From: Austen McClernon Date: Tue, 20 Sep 2022 21:22:32 +0000 Subject: [PATCH] tenantrate: deflake testcloser This patch increases the request size in `TestCloser` in order to jam the request, to assert on timers closing. An earlier patch lowered the RU cost below the burst threshold, making it so that this request never waited. The test previously flaked after 1 run. `53538 runs so far, 0 failures, over 2m5s` resolves: #86822 Release note: None --- pkg/kv/kvserver/tenantrate/BUILD.bazel | 1 - pkg/kv/kvserver/tenantrate/limiter_test.go | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/kv/kvserver/tenantrate/BUILD.bazel b/pkg/kv/kvserver/tenantrate/BUILD.bazel index b17b4ed71389..a052f917eab3 100644 --- a/pkg/kv/kvserver/tenantrate/BUILD.bazel +++ b/pkg/kv/kvserver/tenantrate/BUILD.bazel @@ -41,7 +41,6 @@ go_test( "//pkg/settings/cluster", "//pkg/testutils", "//pkg/testutils/metrictestutils", - "//pkg/testutils/skip", "//pkg/util/leaktest", "//pkg/util/metric", "//pkg/util/timeutil", diff --git a/pkg/kv/kvserver/tenantrate/limiter_test.go b/pkg/kv/kvserver/tenantrate/limiter_test.go index e88e65235fdc..5c24e9ebed9a 100644 --- a/pkg/kv/kvserver/tenantrate/limiter_test.go +++ b/pkg/kv/kvserver/tenantrate/limiter_test.go @@ -26,7 +26,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/settings/cluster" "github.com/cockroachdb/cockroach/pkg/testutils" "github.com/cockroachdb/cockroach/pkg/testutils/metrictestutils" - "github.com/cockroachdb/cockroach/pkg/testutils/skip" "github.com/cockroachdb/cockroach/pkg/util/leaktest" "github.com/cockroachdb/cockroach/pkg/util/metric" "github.com/cockroachdb/cockroach/pkg/util/timeutil" @@ -39,8 +38,6 @@ import ( func TestCloser(t *testing.T) { defer leaktest.AfterTest(t)() - skip.WithIssue(t, 86822, "flaky test") - st := cluster.MakeTestingClusterSettings() start := timeutil.Now() timeSource := timeutil.NewManualTime(start) @@ -54,7 +51,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<<30)) }() + go func() { errCh <- limiter.Wait(ctx, tenantcostmodel.TestingRequestInfo(1, 1, 1<<31)) }() testutils.SucceedsSoon(t, func() error { if timers := timeSource.Timers(); len(timers) != 1 { return errors.Errorf("expected 1 timer, found %d", len(timers))