Skip to content

Commit

Permalink
server: Change runTestConcurrentUpdate to use runTestsOnNewDB (#9906)
Browse files Browse the repository at this point in the history
  • Loading branch information
kolbe authored and zz-jason committed Apr 1, 2019
1 parent 77e91d1 commit 2ee8f42
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,16 +677,21 @@ func runTestLoadData(c *C, server *Server) {
}

func runTestConcurrentUpdate(c *C) {
// TODO: Should be runTestsOnNewDB. See #4205.
runTests(c, nil, func(dbt *DBTest) {
dbName := "Concurrent"
runTestsOnNewDB(c, nil, dbName, func(dbt *DBTest) {
dbt.mustExec("drop table if exists test2")
dbt.mustExec("create table test2 (a int, b int)")
dbt.mustExec("insert test2 values (1, 1)")

txn1, err := dbt.db.Begin()
c.Assert(err, IsNil)
_, err = txn1.Exec(fmt.Sprintf("USE `%s`;", dbName))
c.Assert(err, IsNil)

txn2, err := dbt.db.Begin()
c.Assert(err, IsNil)
_, err = txn2.Exec(fmt.Sprintf("USE `%s`;", dbName))
c.Assert(err, IsNil)

_, err = txn2.Exec("update test2 set a = a + 1 where b = 1")
c.Assert(err, IsNil)
Expand Down

0 comments on commit 2ee8f42

Please sign in to comment.