diff --git a/ddl/ddl_worker_test.go b/ddl/ddl_worker_test.go
index <HASH>..<HASH> 100644
--- a/ddl/ddl_worker_test.go
+++ b/ddl/ddl_worker_test.go
@@ -450,6 +450,11 @@ func (s *testDDLSuite) TestCancelJob(c *C) {
 		if job.State == model.JobStateSynced || job.State == model.JobStateCancelled || job.State == model.JobStateCancelling {
 			return
 		}
+		// This hook only valid for the related test job.
+		// This is use to avoid parallel test fail.
+		if len(test.jobIDs) > 0 && test.jobIDs[0] != job.ID {
+			return
+		}
 		if checkErr != nil {
 			return
 		}
ddl: fix ddl test fail by paralle test (#<I>)