Skip to content

Commit e3f2c14

Browse files
committed
sql: bump up cluster setting read timeout for benchmark tests
Previously, we would see flakes on TestBenchmarkExpectation related to updating cluster settings and not being able to see the updated values after SET CLUSTER SETTING. We suspect this flake happens because under load, it may take longer for the cluster setting update to be visible. To address this, this patch modifies the cluster setting timeout for benchmark tests to prevent these flakes. Fixes: #154219 Release note: None
1 parent 588e5f6 commit e3f2c14

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/sql/set_cluster_setting.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import (
4040
"github.com/cockroachdb/cockroach/pkg/sql/sessioninit"
4141
"github.com/cockroachdb/cockroach/pkg/sql/sqltelemetry"
4242
"github.com/cockroachdb/cockroach/pkg/sql/types"
43+
"github.com/cockroachdb/cockroach/pkg/util/buildutil"
4344
"github.com/cockroachdb/cockroach/pkg/util/humanizeutil"
4445
"github.com/cockroachdb/cockroach/pkg/util/log"
4546
"github.com/cockroachdb/cockroach/pkg/util/log/eventpb"
@@ -701,7 +702,12 @@ func waitForSettingUpdate(
701702
}
702703
errNotReady := errors.New("setting updated but timed out waiting to read new value")
703704
var observed string
704-
err := retry.ForDuration(10*time.Second, func() error {
705+
defaultDuration := 10 * time.Second
706+
// Bench tests maybe more prone to flaking, so use a longer time limit for them.
707+
if buildutil.CrdbBenchBuild {
708+
defaultDuration *= 3
709+
}
710+
err := retry.ForDuration(defaultDuration, func() error {
705711
observed = setting.Encoded(&execCfg.Settings.SV)
706712
if observed != expectedEncodedValue {
707713
return errNotReady

0 commit comments

Comments
 (0)