Skip to content

Commit

Permalink
fix TestStateChange (pingcap#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
Defined2014 authored Mar 18, 2022
1 parent 83df019 commit d41e198
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ddl/db_change_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ type stateChangeSuite struct {
}

func TestStateChange(t *testing.T) {
t.Skip("Skip for multi-schema change")
suite.Run(t, new(stateChangeSuite))
}

Expand Down Expand Up @@ -821,15 +820,19 @@ func (s *stateChangeSuite) runTestInSchemaState(

callback := &ddl.TestDDLCallback{Do: s.dom}
prevState := model.StateNone
times := 0
var checkErr error
se, err := session.CreateSession(s.store)
s.Require().NoError(err)
_, err = se.Execute(context.Background(), "use test_db_state")
s.Require().NoError(err)
cbFunc := func(job *model.Job) {
if currentSchemaState(job) == prevState || checkErr != nil {
if currentSchemaState(job) == prevState || checkErr != nil || times >= 3 {
return
}
if job.MultiSchemaInfo == nil {
times++
}
if currentSchemaState(job) != state {
return
}
Expand Down

0 comments on commit d41e198

Please sign in to comment.