Skip to content

Commit

Permalink
Flakes: Shutdown vttablet before mysqld in backup tests (vitessio#14647)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord authored and ejortegau committed Dec 13, 2023
1 parent c5ee488 commit 0fbae2e
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions go/test/endtoend/backup/vtbackup/backup_only_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,12 @@ func resetTabletDirectory(t *testing.T, tablet cluster.Vttablet, initMysql bool)
extraArgs := []string{"--db-credentials-file", dbCredentialFile}
tablet.MysqlctlProcess.ExtraArgs = extraArgs

// Shutdown Mysql
err := tablet.MysqlctlProcess.Stop()
require.Nil(t, err)
// Teardown Tablet
err = tablet.VttabletProcess.TearDown()
err := tablet.VttabletProcess.TearDown()
require.Nil(t, err)

// Shutdown Mysql
err = tablet.MysqlctlProcess.Stop()
require.Nil(t, err)

// Clear out the previous data
Expand Down Expand Up @@ -335,13 +336,7 @@ func tearDown(t *testing.T, initMysql bool) {
require.Nil(t, err)
}

// TODO: Ideally we should not be resetting the mysql.
// So in below code we will have to uncomment the commented code and remove resetTabletDirectory
for _, tablet := range []cluster.Vttablet{*primary, *replica1, *replica2} {
//Tear down Tablet
//err := tablet.VttabletProcess.TearDown()
//require.Nil(t, err)

resetTabletDirectory(t, tablet, initMysql)
// DeleteTablet on a primary will cause tablet to shutdown, so should only call it after tablet is already shut down
err := localCluster.VtctlclientProcess.ExecuteCommand("DeleteTablet", "--", "--allow_primary", tablet.Alias)
Expand Down

0 comments on commit 0fbae2e

Please sign in to comment.