diff --git a/ddl/ddl_worker_test.go b/ddl/ddl_worker_test.go index 72fef7c96c19e..5085e4194f0d1 100644 --- a/ddl/ddl_worker_test.go +++ b/ddl/ddl_worker_test.go @@ -100,7 +100,10 @@ func (s *testDDLSuite) TestNotifyDDLJob(c *C) { WithStore(store), WithLease(testLease), ) - defer d.Stop() + defer func() { + err := d.Stop() + c.Assert(err, IsNil) + }() getFirstNotificationAfterStartDDL(d) // Ensure that the notification is not handled in workers `start` function. d.cancel() @@ -141,7 +144,10 @@ func (s *testDDLSuite) TestNotifyDDLJob(c *C) { WithStore(store), WithLease(testLease), ) - defer d1.Stop() + defer func() { + err := d1.Stop() + c.Assert(err, IsNil) + }() getFirstNotificationAfterStartDDL(d1) // Ensure that the notification is not handled by worker's "start". d1.cancel()