Skip to content

Commit

Permalink
necessary go changes + two more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimov committed Nov 8, 2023
1 parent e58ebef commit a5ae0c5
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/cluster_endtoend_mysql80.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ jobs:
- name: Set up Go
if: steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.19.12
go-version: '1.20'
check-latest: true

- name: Set up python
if: steps.changes.outputs.end_to_end == 'true'
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/endtoend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.19.12
go-version: '1.20'
check-latest: true

- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
3 changes: 3 additions & 0 deletions go/bucketpool/bucketpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ func TestFuzz(t *testing.T) {
maxTestSize := 16384
for i := 0; i < 20000; i++ {
minSize := rand.Intn(maxTestSize)
if minSize == 0 {
minSize = 1
}
maxSize := rand.Intn(maxTestSize-minSize) + minSize
p := New(minSize, maxSize)
bufSize := rand.Intn(maxTestSize)
Expand Down
2 changes: 1 addition & 1 deletion go/mysql/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ func TestTLSClientVerifyIdentity(t *testing.T) {

fmt.Printf("Error: %s", err)

assert.Contains(t, err.Error(), "cannot send HandshakeResponse41: x509:")
assert.Contains(t, err.Error(), "cannot send HandshakeResponse41: tls:")

// Now setup proper CA that is valid to verify
params.SslCa = path.Join(root, "ca-cert.pem")
Expand Down
3 changes: 1 addition & 2 deletions go/test/endtoend/recovery/recovery_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ func RestoreTablet(t *testing.T, localCluster *cluster.LocalProcessCluster, tabl

if err != nil {
tm := time.Now().UTC()
tm.Format(time.RFC3339)
_, err := localCluster.VtctlProcess.ExecuteCommandWithOutput("CreateKeyspace", "--",
"--keyspace_type=SNAPSHOT", "--base_keyspace="+keyspaceName,
"--snapshot_time", restoreTime.Format(time.RFC3339), restoreKSName)
"--snapshot_time", tm.Format(time.RFC3339), restoreKSName)
require.Nil(t, err)
}

Expand Down
8 changes: 3 additions & 5 deletions go/test/fuzzing/vtctl_fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ func Fuzz(data []byte) int {
chunkSize := len(restOfArray) / numberOfCalls
command := 0
for i := 0; i < len(restOfArray); i = i + chunkSize {
from := i //lower
to := i + chunkSize //upper
from := i // lower
to := i + chunkSize // upper

// Index of command in getCommandType():
commandIndex := int(commandPart[command]) % 68
Expand All @@ -179,9 +179,7 @@ func Fuzz(data []byte) int {
args := strings.Split(string(restOfArray[from:to]), " ")

// Add params to the command
for i := range args {
commandSlice = append(commandSlice, args[i])
}
commandSlice = append(commandSlice, args...)

_ = vtctl.RunCommand(ctx, wrangler.New(logger, topo, tmc), commandSlice)
command++
Expand Down
3 changes: 3 additions & 0 deletions go/vt/orchestrator/logic/topology_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,9 @@ func recoverDeadPrimary(ctx context.Context, analysisEntry inst.ReplicationAnaly

// Read the tablet information from the database to find the shard and keyspace of the tablet
tablet, err := inst.ReadTablet(analysisEntry.AnalyzedInstanceKey)
if err != nil {
return false, nil, err
}

var candidateTabletAlias *topodatapb.TabletAlias
if candidateInstanceKey != nil {
Expand Down

0 comments on commit a5ae0c5

Please sign in to comment.