Skip to content

Commit

Permalink
util/ddl-checker: fix DATA RACE in TestExecute (pingcap#33781)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao authored Apr 7, 2022
1 parent 15a01fa commit 942f4d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion util/ddl-checker/executable_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ func TestExecute(t *testing.T) {
tk.MustExec("use test;")
for e := testData.Front(); e != nil; e = e.Next() {
data := e.Value.(parseTestData)
_, err := tk.Exec(data.sql)
res, err := tk.Exec(data.sql)
require.Equal(t, data.executeSucceeded, err == nil)
if res != nil {
res.Close()
}
}
}

0 comments on commit 942f4d1

Please sign in to comment.