ddl: stabilize test TestParallelDDLBeforeRunDDLJob (#18227)

Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
This commit is contained in:
wjHuang
2020-07-02 19:02:08 +08:00
committed by GitHub
parent a99ae5340e
commit b69b49ef34

View File

@ -1321,6 +1321,8 @@ func (s *testStateChangeSuite) TestParallelDDLBeforeRunDDLJob(c *C) {
se.SetConnectionID(firstConnID)
_, err1 := se.Execute(context.Background(), "alter table test_table drop column c2")
c.Assert(err1, IsNil)
// Sleep a while to make sure the connection 2 break out the first for loop in OnGetInfoSchemaExported, otherwise atomic.LoadInt32(&sessionCnt) == 2 will be false forever.
time.Sleep(100 * time.Millisecond)
atomic.StoreInt32(&sessionCnt, finishedCnt)
}()
go func() {