Skip to content

Commit

Permalink
Don't use a socket by default in newTestConfig()
Browse files Browse the repository at this point in the history
  • Loading branch information
dveeden committed Dec 6, 2021
1 parent 2408cac commit a4db184
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 14 deletions.
3 changes: 0 additions & 3 deletions server/conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ func TestInitialHandshake(t *testing.T) {

var outBuffer bytes.Buffer
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = 0
cfg.Status.StatusPort = 0
drv := NewTiDBDriver(store)
Expand Down Expand Up @@ -489,7 +488,6 @@ func testDispatch(t *testing.T, inputs []dispatchInput, capability uint32) {
var outBuffer bytes.Buffer
tidbdrv := NewTiDBDriver(store)
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port, cfg.Status.StatusPort = 0, 0
cfg.Status.ReportStatus = false
server, err := NewServer(cfg, tidbdrv)
Expand Down Expand Up @@ -1134,7 +1132,6 @@ func TestAuthPlugin2(t *testing.T) {
defer clean()

cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = 0
cfg.Status.StatusPort = 0

Expand Down
5 changes: 0 additions & 5 deletions server/tidb_serial_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ func TestTLSAuto(t *testing.T) {
}
cli := newTestServerClient()
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = cli.port
cfg.Status.ReportStatus = false
cfg.Security.AutoTLS = true
Expand Down Expand Up @@ -162,7 +161,6 @@ func TestTLSBasic(t *testing.T) {
}
cli := newTestServerClient()
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = cli.port
cfg.Status.ReportStatus = false
cfg.Security = config.Security{
Expand Down Expand Up @@ -234,7 +232,6 @@ func TestTLSVerify(t *testing.T) {
// Start the server with TLS & CA, if the client presents its certificate, the certificate will be verified.
cli := newTestServerClient()
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = cli.port
cfg.Status.ReportStatus = false
cfg.Security = config.Security{
Expand Down Expand Up @@ -302,7 +299,6 @@ func TestErrorNoRollback(t *testing.T) {

cli := newTestServerClient()
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = cli.port
cfg.Status.ReportStatus = false

Expand Down Expand Up @@ -422,7 +418,6 @@ func TestReloadTLS(t *testing.T) {
// try old cert used in startup configuration.
cli := newTestServerClient()
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = cli.port
cfg.Status.ReportStatus = false
cfg.Security = config.Security{
Expand Down
6 changes: 0 additions & 6 deletions server/tidb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func createTidbTestSuite(t *testing.T) (*tidbTestSuite, func()) {
require.NoError(t, err)
ts.tidbdrv = NewTiDBDriver(ts.store)
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = ts.port
cfg.Status.ReportStatus = true
cfg.Status.StatusPort = ts.statusPort
Expand Down Expand Up @@ -242,7 +241,6 @@ func TestStatusPort(t *testing.T) {
defer cleanup()

cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = 0
cfg.Status.ReportStatus = true
cfg.Status.StatusPort = ts.statusPort
Expand Down Expand Up @@ -273,7 +271,6 @@ func TestStatusAPIWithTLS(t *testing.T) {
cli := newTestServerClient()
cli.statusScheme = "https"
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = cli.port
cfg.Status.StatusPort = cli.statusPort
cfg.Security.ClusterSSLCA = "/tmp/ca-cert-2.pem"
Expand Down Expand Up @@ -329,7 +326,6 @@ func TestStatusAPIWithTLSCNCheck(t *testing.T) {
cli := newTestServerClient()
cli.statusScheme = "https"
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port = cli.port
cfg.Status.StatusPort = cli.statusPort
cfg.Security.ClusterSSLCA = caPath
Expand Down Expand Up @@ -887,7 +883,6 @@ func TestSystemTimeZone(t *testing.T) {

tk := testkit.NewTestKit(t, ts.store)
cfg := newTestConfig()
cfg.Socket = ""
cfg.Port, cfg.Status.StatusPort = 0, 0
cfg.Status.ReportStatus = false
server, err := NewServer(cfg, ts.tidbdrv)
Expand Down Expand Up @@ -1216,7 +1211,6 @@ func TestGracefulShutdown(t *testing.T) {

cli := newTestServerClient()
cfg := newTestConfig()
cfg.Socket = ""
cfg.GracefulWaitBeforeShutdown = 2 // wait before shutdown
cfg.Port = 0
cfg.Status.StatusPort = 0
Expand Down
1 change: 1 addition & 0 deletions server/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,5 +604,6 @@ func newTestConfig() *config.Config {
cfg.Host = "127.0.0.1"
cfg.Status.StatusHost = "127.0.0.1"
cfg.Security.AutoTLS = false
cfg.Socket = ""
return cfg
}

0 comments on commit a4db184

Please sign in to comment.