Skip to content

Commit

Permalink
try make test cases more stable
Browse files Browse the repository at this point in the history
Signed-off-by: Yu Juncen <yu745514916@live.com>
  • Loading branch information
YuJuncen committed Mar 13, 2024
1 parent f8738a5 commit 5129f10
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/realtikvtest/brietest/backup_restore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ func TestBackupAndRestore(t *testing.T) {

func TestRestoreMultiTables(t *testing.T) {
tk := initTestKit(t)
tk.MustExec("create database if not exists br")
tk.MustExec("use br")
tk.MustExec("create database if not exists TestRestoreMultiTables")
tk.MustExec("use TestRestoreMultiTables")

tablesNameSet := make(map[string]struct{})
tableNum := 1000
Expand All @@ -90,10 +90,10 @@ func TestRestoreMultiTables(t *testing.T) {
tmpDir := path.Join(os.TempDir(), "bk1")
require.NoError(t, os.RemoveAll(tmpDir))
// backup database to tmp dir
tk.MustQuery("backup database br to 'local://" + tmpDir + "'")
tk.MustQuery("backup database TestRestoreMultiTables to 'local://" + tmpDir + "'")

// remove database for recovery
tk.MustExec("drop database br")
tk.MustExec("drop database TestRestoreMultiTables")

// restore database with backup data
tk.MustQuery("restore database * from 'local://" + tmpDir + "'")
Expand All @@ -113,5 +113,5 @@ func TestRestoreMultiTables(t *testing.T) {
for i := 0; i < tableNum; i += 1 {
tk.MustQuery(fmt.Sprintf("select count(*) from table_%d", i)).Check(testkit.Rows("1"))
}
tk.MustExec("drop database br")
tk.MustExec("drop database TestRestoreMultiTables")
}

0 comments on commit 5129f10

Please sign in to comment.