Skip to content

Commit 3de9757

Browse files
committed
catalog/lease: fix flake for TestTableCreationPushesTxnsInRecentPast
Previously, TestTableCreationPushesTxnsInRecentPast could flake because we attempted to increase odds of hitting the uncertainty interval error by adding a delay on KV RPC calls. This wasn't effective and could still intermittent failures, and instead we are going to directly modify the uncertainty interval by setting a large MaxOffset on the clock. This will cause the desired behaviour in a more deterministic way. Fixes: #114366 Release note: None
1 parent f71ed12 commit 3de9757

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

pkg/sql/catalog/lease/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ go_test(
8888
"//pkg/jobs/jobspb",
8989
"//pkg/keys",
9090
"//pkg/kv",
91-
"//pkg/kv/kvclient/kvcoord",
9291
"//pkg/kv/kvpb",
9392
"//pkg/kv/kvserver",
9493
"//pkg/kv/kvserver/kvserverbase",

pkg/sql/catalog/lease/lease_test.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"github.com/cockroachdb/cockroach/pkg/jobs/jobspb"
2929
"github.com/cockroachdb/cockroach/pkg/keys"
3030
"github.com/cockroachdb/cockroach/pkg/kv"
31-
"github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord"
3231
"github.com/cockroachdb/cockroach/pkg/kv/kvpb"
3332
"github.com/cockroachdb/cockroach/pkg/kv/kvserver"
3433
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvserverbase"
@@ -2028,12 +2027,8 @@ func TestTableCreationPushesTxnsInRecentPast(t *testing.T) {
20282027
tc := serverutils.StartCluster(t, 3, base.TestClusterArgs{
20292028
ServerArgs: base.TestServerArgs{
20302029
Knobs: base.TestingKnobs{
2031-
KVClient: &kvcoord.ClientTestingKnobs{
2032-
// Intentionally add latency so that the uncertainty
2033-
// limit is higher to reduce the risk of this test flaking.
2034-
LatencyFunc: func(id roachpb.NodeID) (time.Duration, bool) {
2035-
return time.Millisecond * 100, true
2036-
},
2030+
Store: &kvserver.StoreTestingKnobs{
2031+
MaxOffset: time.Second,
20372032
},
20382033
},
20392034
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(109385),

0 commit comments

Comments
 (0)