Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
djshow832 committed Dec 9, 2021
1 parent ed05054 commit 3b7e55d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ddl/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7307,7 +7307,7 @@ func (s *testSerialDBSuite) TestCancelJobWriteConflict(c *C) {
d.(ddl.DDLForTest).SetHook(hook)
defer d.(ddl.DDLForTest).SetHook(originalHook)

// Cancelling will be retried but it still fails, and adding index succeeds.
// Test when cancelling cannot be retried and adding index succeeds.
hook.OnJobRunBeforeExported = func(job *model.Job) {
if job.Type == model.ActionAddIndex && job.State == model.JobStateRunning && job.SchemaState == model.StateWriteReorganization {
stmt := fmt.Sprintf("admin cancel ddl jobs %d", job.ID)
Expand All @@ -7319,7 +7319,7 @@ func (s *testSerialDBSuite) TestCancelJobWriteConflict(c *C) {
tk.MustExec("alter table t add index (id)")
c.Assert(cancelErr.Error(), Equals, "mock commit error")

// Cancelling will be retried only once and it succeeds at the end.
// Test when cancelling is retried only once and adding index is cancelled in the end.
var jobID int64
hook.OnJobRunBeforeExported = func(job *model.Job) {
if job.Type == model.ActionAddIndex && job.State == model.JobStateRunning && job.SchemaState == model.StateWriteReorganization {
Expand Down

0 comments on commit 3b7e55d

Please sign in to comment.