Skip to content

Commit baf9fa8

Browse files
Use flags helper in VReplication Config constructor
Signed-off-by: Rohit Nayak <[email protected]>
1 parent ff62324 commit baf9fa8

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

go/test/endtoend/vtgate/schematracker/viewsdisabled/schema_views_disabled_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"os"
2727
"testing"
2828
"time"
29+
2930
vtutils "vitess.io/vitess/go/vt/utils"
3031

3132
"github.com/stretchr/testify/assert"

go/test/endtoend/vtgate/vschema/vschema_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func writeConfig(path string, cfg map[string]string) error {
133133
return json.NewEncoder(file).Encode(cfg)
134134
}
135135

136-
func TestVSchema1(t *testing.T) {
136+
func TestVSchema(t *testing.T) {
137137
ctx := context.Background()
138138
conn, err := mysql.Connect(ctx, &vtParams)
139139
require.NoError(t, err)

go/vt/vttablet/common/config.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import (
2424
"strings"
2525
"sync"
2626
"time"
27+
"vitess.io/vitess/go/test/endtoend/cluster"
28+
vtutils "vitess.io/vitess/go/vt/utils"
2729
)
2830

2931
/*
@@ -131,6 +133,10 @@ func NewVReplicationConfig(overrides map[string]string) (*VReplicationConfig, er
131133
getError := func(k, v string) string {
132134
return fmt.Sprintf("invalid value for %s: %s", k, v)
133135
}
136+
vttabletVersion, err := cluster.GetMajorVersion("vttablet")
137+
if err != nil {
138+
return nil, err
139+
}
134140
for k, v := range overrides {
135141
if v == "" {
136142
continue
@@ -178,14 +184,14 @@ func NewVReplicationConfig(overrides map[string]string) (*VReplicationConfig, er
178184
} else {
179185
c.MaxTimeToRetryError = value
180186
}
181-
case "relay-log-max-size", "relay_log_max_size":
187+
case vtutils.GetFlagVariantForTestsByVersion("relay-log-max-size", vttabletVersion):
182188
value, err := strconv.Atoi(v)
183189
if err != nil {
184190
errors = append(errors, getError(k, v))
185191
} else {
186192
c.RelayLogMaxSize = value
187193
}
188-
case "relay-log-max-items", "relay_log_max_items":
194+
case vtutils.GetFlagVariantForTestsByVersion("relay-log-max-items", vttabletVersion):
189195
value, err := strconv.Atoi(v)
190196
if err != nil {
191197
errors = append(errors, getError(k, v))

0 commit comments

Comments
 (0)