Skip to content

Commit

Permalink
kvserver: deflake TestProtectedTimestamps
Browse files Browse the repository at this point in the history
This patch fixes a few (hopefully all) issues with
TestProtectedTimestamps. In particular,

- The range max bytes used by the test was broken after
the lower bound was bumped in a37e053.
We up the value.
- There was flakiness at various points in the test as a result of lease
transfers. We change the test to run on a single node test cluster to
get around this.

Fixes: #93497

Release note: None
  • Loading branch information
arulajmani committed Jun 27, 2023
1 parent 191343f commit cf6eb79
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/kv/kvserver/client_protectedts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import (
func TestProtectedTimestamps(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
skip.WithIssue(t, 93497, "flaky test")
ctx := context.Background()

// This test is too slow to run with race.
Expand All @@ -59,7 +58,7 @@ func TestProtectedTimestamps(t *testing.T) {
DisableGCQueue: true,
DisableLastProcessedCheck: true,
}
tc := testcluster.StartTestCluster(t, 3, args)
tc := testcluster.StartTestCluster(t, 1, args)
defer tc.Stopper().Stop(ctx)
s0 := tc.Server(0)

Expand All @@ -73,7 +72,7 @@ func TestProtectedTimestamps(t *testing.T) {
_, err = conn.Exec("SET CLUSTER SETTING kv.closed_timestamp.target_duration = '100ms'") // speeds up the test
require.NoError(t, err)

const tableRangeMaxBytes = 1 << 18
const tableRangeMaxBytes = 64 << 20
_, err = conn.Exec("ALTER TABLE foo CONFIGURE ZONE USING "+
"gc.ttlseconds = 1, range_max_bytes = $1, range_min_bytes = 1<<10;", tableRangeMaxBytes)
require.NoError(t, err)
Expand Down

0 comments on commit cf6eb79

Please sign in to comment.