diff --git a/server/conn_test.go b/server/conn_test.go index f5be261c8d541..7beb523c85103 100644 --- a/server/conn_test.go +++ b/server/conn_test.go @@ -428,10 +428,11 @@ func (ts *ConnTestSuite) testDispatch(c *C, inputs []dispatchInput, capability u var outBuffer bytes.Buffer tidbdrv := NewTiDBDriver(ts.store) cfg := config.NewConfig() - cfg.Port = 4005 + cfg.Port = genPort() cfg.Status.ReportStatus = false server, err := NewServer(cfg, tidbdrv) c.Assert(err, IsNil) + defer server.Close() cc := &clientConn{ connectionID: 1,