Skip to content

Commit

Permalink
test: backup test fix
Browse files Browse the repository at this point in the history
Signed-off-by: Manan Gupta <manan@planetscale.com>
  • Loading branch information
GuptaManan100 committed Dec 26, 2023
1 parent 3935f8b commit bc19754
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 5 additions & 3 deletions go/test/endtoend/backup/vtbackup/backup_only_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,17 @@ func restore(t *testing.T, tablet *cluster.Vttablet, tabletType string, waitForS
log.Infof("restoring tablet %s", time.Now())
resetTabletDirectory(t, *tablet, true)

err := tablet.VttabletProcess.CreateDB(keyspaceName)
require.Nil(t, err)
if localCluster.VtTabletMajorVersion <= 16 {
err := tablet.VttabletProcess.CreateDB(keyspaceName)
require.Nil(t, err)
}

// Start tablets
tablet.VttabletProcess.ExtraArgs = []string{"--db-credentials-file", dbCredentialFile}
tablet.VttabletProcess.TabletType = tabletType
tablet.VttabletProcess.ServingStatus = waitForState
tablet.VttabletProcess.SupportsBackup = true
err = tablet.VttabletProcess.Setup()
err := tablet.VttabletProcess.Setup()
require.Nil(t, err)
}

Expand Down
3 changes: 1 addition & 2 deletions go/test/endtoend/backup/vtbackup/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ func TestMain(m *testing.M) {
}

// Create database
vttabletVersion, _ := cluster.GetMajorVersion("vttablet")
if vttabletVersion <= 16 {
if localCluster.VtTabletMajorVersion <= 16 {
for _, tablet := range []cluster.Vttablet{*primary, *replica1} {
if err := tablet.VttabletProcess.CreateDB(keyspaceName); err != nil {
return 1, err
Expand Down

0 comments on commit bc19754

Please sign in to comment.