Skip to content

Commit

Permalink
Merge pull request #100100 from erikgrinaker/backport22.2-96632-98491
Browse files Browse the repository at this point in the history
release-22.2: roachtest: maybe deflake `change-replicas/mixed-version`
  • Loading branch information
erikgrinaker authored Mar 30, 2023
2 parents 2459f2e + 5cd80f1 commit 9aa5d3f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/cmd/roachtest/tests/mixed_version_change_replicas.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/registry"
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/test"
"github.com/cockroachdb/cockroach/pkg/util/randutil"
"github.com/cockroachdb/cockroach/pkg/util/retry"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -119,8 +120,15 @@ func runChangeReplicasMixedVersion(ctx context.Context, t test.Test, c cluster.C
conn := u.c.Conn(ctx, t.L(), gateway)
defer conn.Close()

retryOpts := retry.Options{
InitialBackoff: 100 * time.Millisecond,
MaxBackoff: 5 * time.Second,
Multiplier: 2,
MaxRetries: 12,
}
var rangeErrors map[int]string
for attempt := 1; attempt <= 5; attempt++ {
for r := retry.StartWithCtx(ctx, retryOpts); r.Next(); {
setReplicateQueueEnabled(false)
if errCount := len(rangeErrors); errCount > 0 {
t.L().Printf("%d ranges failed, retrying", errCount)
}
Expand All @@ -145,6 +153,10 @@ func runChangeReplicasMixedVersion(ctx context.Context, t test.Test, c cluster.C
if len(rangeErrors) == 0 {
break
}
// The failure may be caused by conflicts with ongoing configuration
// changes by the replicate queue, so we re-enable it and let it run
// for a bit before the next retry.
setReplicateQueueEnabled(true)
}

if len(rangeErrors) > 0 {
Expand Down

0 comments on commit 9aa5d3f

Please sign in to comment.