diff --git a/command/agent/agent.go b/command/agent/agent.go index 01e8f3c57..fd3cd88b7 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -337,7 +337,7 @@ func (a *Agent) listenAndServeDNS() error { err := s.ListenAndServe(p.Net, p.Addr, func() { notif <- p }) if err != nil && !strings.Contains(err.Error(), "accept") { - a.logger.Printf("[ERR] agent: Error starting DNS server %s (%s): ", p.Addr, p.Net, err) + a.logger.Printf("[ERR] agent: Error starting DNS server %s (%s): %v", p.Addr, p.Net, err) } }() } diff --git a/command/agent/testagent.go b/command/agent/testagent.go index 3c8004966..0090462ed 100644 --- a/command/agent/testagent.go +++ b/command/agent/testagent.go @@ -120,11 +120,9 @@ func (a *TestAgent) Start() *TestAgent { } id := UniqueID() - // since the ports are written into the data files we pick random ports - // only once and try a number of times to start with them. - pickRandomPorts(a.Config) - for i := 10; i >= 0; i-- { + pickRandomPorts(a.Config) + // write the keyring if a.Key != "" { writeKey := func(key, filename string) { @@ -163,6 +161,16 @@ func (a *TestAgent) Start() *TestAgent { fmt.Println(id, a.Name, "retrying in", wait) time.Sleep(wait) } + + // Clean out the data dir if we are responsible for it before we + // try again, since the old ports may have gotten written to + // the data dir, such as in the Raft configuration. + if a.DataDir != "" { + if err := os.RemoveAll(a.DataDir); err != nil { + fmt.Println(id, a.Name, "Error resetting data dir:", err) + runtime.Goexit() + } + } } if !a.NoInitialSync { a.Agent.StartSync() diff --git a/consul/acl_endpoint_test.go b/consul/acl_endpoint_test.go index 73c7b3e42..4e524dc32 100644 --- a/consul/acl_endpoint_test.go +++ b/consul/acl_endpoint_test.go @@ -14,7 +14,6 @@ import ( ) func TestACLEndpoint_Apply(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -75,7 +74,6 @@ func TestACLEndpoint_Apply(t *testing.T) { } func TestACLEndpoint_Update_PurgeCache(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -154,7 +152,6 @@ func TestACLEndpoint_Update_PurgeCache(t *testing.T) { } func TestACLEndpoint_Apply_CustomID(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -202,7 +199,6 @@ func TestACLEndpoint_Apply_CustomID(t *testing.T) { } func TestACLEndpoint_Apply_Denied(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" }) @@ -229,7 +225,6 @@ func TestACLEndpoint_Apply_Denied(t *testing.T) { } func TestACLEndpoint_Apply_DeleteAnon(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -259,7 +254,6 @@ func TestACLEndpoint_Apply_DeleteAnon(t *testing.T) { } func TestACLEndpoint_Apply_RootChange(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -289,7 +283,6 @@ func TestACLEndpoint_Apply_RootChange(t *testing.T) { } func TestACLEndpoint_Get(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -337,7 +330,6 @@ func TestACLEndpoint_Get(t *testing.T) { } func TestACLEndpoint_GetPolicy(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -395,7 +387,6 @@ func TestACLEndpoint_GetPolicy(t *testing.T) { } func TestACLEndpoint_List(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -457,7 +448,6 @@ func TestACLEndpoint_List(t *testing.T) { } func TestACLEndpoint_List_Denied(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" }) @@ -479,7 +469,6 @@ func TestACLEndpoint_List_Denied(t *testing.T) { } func TestACLEndpoint_ReplicationStatus(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc2" c.ACLReplicationToken = "secret" diff --git a/consul/catalog_endpoint_test.go b/consul/catalog_endpoint_test.go index e273be46b..86f1622fa 100644 --- a/consul/catalog_endpoint_test.go +++ b/consul/catalog_endpoint_test.go @@ -18,7 +18,6 @@ import ( ) func TestCatalog_Register(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -48,7 +47,6 @@ func TestCatalog_Register(t *testing.T) { } func TestCatalog_RegisterService_InvalidAddress(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -78,7 +76,6 @@ func TestCatalog_RegisterService_InvalidAddress(t *testing.T) { } func TestCatalog_Register_NodeID(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -114,7 +111,6 @@ func TestCatalog_Register_NodeID(t *testing.T) { } func TestCatalog_Register_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -216,7 +212,6 @@ service "foo" { } func TestCatalog_Register_ForwardLeader(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -260,7 +255,6 @@ func TestCatalog_Register_ForwardLeader(t *testing.T) { } func TestCatalog_Register_ForwardDC(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -293,7 +287,6 @@ func TestCatalog_Register_ForwardDC(t *testing.T) { } func TestCatalog_Deregister(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -319,7 +312,6 @@ func TestCatalog_Deregister(t *testing.T) { } func TestCatalog_Deregister_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -531,7 +523,6 @@ service "service" { } func TestCatalog_ListDatacenters(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -565,7 +556,6 @@ func TestCatalog_ListDatacenters(t *testing.T) { } func TestCatalog_ListDatacenters_DistanceSort(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -604,7 +594,6 @@ func TestCatalog_ListDatacenters_DistanceSort(t *testing.T) { } func TestCatalog_ListNodes(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -646,7 +635,6 @@ func TestCatalog_ListNodes(t *testing.T) { } func TestCatalog_ListNodes_NodeMetaFilter(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -709,7 +697,6 @@ func TestCatalog_ListNodes_NodeMetaFilter(t *testing.T) { } func TestCatalog_ListNodes_StaleRaad(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -774,7 +761,6 @@ func TestCatalog_ListNodes_StaleRaad(t *testing.T) { } func TestCatalog_ListNodes_ConsistentRead_Fail(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -821,7 +807,6 @@ func TestCatalog_ListNodes_ConsistentRead_Fail(t *testing.T) { } func TestCatalog_ListNodes_ConsistentRead(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -866,7 +851,6 @@ func TestCatalog_ListNodes_ConsistentRead(t *testing.T) { } func TestCatalog_ListNodes_DistanceSort(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -957,7 +941,6 @@ func TestCatalog_ListNodes_DistanceSort(t *testing.T) { } func TestCatalog_ListNodes_ACLFilter(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -1058,7 +1041,6 @@ func Benchmark_Catalog_ListNodes(t *testing.B) { } func TestCatalog_ListServices(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -1109,7 +1091,6 @@ func TestCatalog_ListServices(t *testing.T) { } func TestCatalog_ListServices_NodeMetaFilter(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -1173,7 +1154,6 @@ func TestCatalog_ListServices_NodeMetaFilter(t *testing.T) { } func TestCatalog_ListServices_Blocking(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -1232,7 +1212,6 @@ func TestCatalog_ListServices_Blocking(t *testing.T) { } func TestCatalog_ListServices_Timeout(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -1274,7 +1253,6 @@ func TestCatalog_ListServices_Timeout(t *testing.T) { } func TestCatalog_ListServices_Stale(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -1312,7 +1290,6 @@ func TestCatalog_ListServices_Stale(t *testing.T) { } func TestCatalog_ListServiceNodes(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -1362,7 +1339,6 @@ func TestCatalog_ListServiceNodes(t *testing.T) { } func TestCatalog_ListServiceNodes_NodeMetaFilter(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -1463,7 +1439,6 @@ func TestCatalog_ListServiceNodes_NodeMetaFilter(t *testing.T) { } func TestCatalog_ListServiceNodes_DistanceSort(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -1551,7 +1526,6 @@ func TestCatalog_ListServiceNodes_DistanceSort(t *testing.T) { } func TestCatalog_NodeServices(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -1602,7 +1576,6 @@ func TestCatalog_NodeServices(t *testing.T) { // Used to check for a regression against a known bug func TestCatalog_Register_FailedCase1(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -1722,7 +1695,6 @@ service "foo" { } func TestCatalog_ListServices_FilterACL(t *testing.T) { - t.Parallel() dir, token, srv, codec := testACLFilterServer(t) defer os.RemoveAll(dir) defer srv.Shutdown() @@ -1745,7 +1717,6 @@ func TestCatalog_ListServices_FilterACL(t *testing.T) { } func TestCatalog_ServiceNodes_FilterACL(t *testing.T) { - t.Parallel() dir, token, srv, codec := testACLFilterServer(t) defer os.RemoveAll(dir) defer srv.Shutdown() @@ -1795,7 +1766,6 @@ func TestCatalog_ServiceNodes_FilterACL(t *testing.T) { } func TestCatalog_NodeServices_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -1871,7 +1841,6 @@ node "%s" { } func TestCatalog_NodeServices_FilterACL(t *testing.T) { - t.Parallel() dir, token, srv, codec := testACLFilterServer(t) defer os.RemoveAll(dir) defer srv.Shutdown() diff --git a/consul/coordinate_endpoint_test.go b/consul/coordinate_endpoint_test.go index c0a1b1680..3158ceba9 100644 --- a/consul/coordinate_endpoint_test.go +++ b/consul/coordinate_endpoint_test.go @@ -42,7 +42,6 @@ func verifyCoordinatesEqual(t *testing.T, a, b *coordinate.Coordinate) { } func TestCoordinate_Update(t *testing.T) { - t.Parallel() name := fmt.Sprintf("Node %d", getPort()) dir1, config1 := testServerConfig(t, name) defer os.RemoveAll(dir1) @@ -199,7 +198,6 @@ func TestCoordinate_Update(t *testing.T) { } func TestCoordinate_Update_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -281,7 +279,6 @@ node "node1" { } func TestCoordinate_ListDatacenters(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -312,7 +309,6 @@ func TestCoordinate_ListDatacenters(t *testing.T) { } func TestCoordinate_ListNodes(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -385,7 +381,6 @@ func TestCoordinate_ListNodes(t *testing.T) { } func TestCoordinate_ListNodes_ACLFilter(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" diff --git a/consul/health_endpoint_test.go b/consul/health_endpoint_test.go index 259dd8bfc..2d0dea880 100644 --- a/consul/health_endpoint_test.go +++ b/consul/health_endpoint_test.go @@ -13,7 +13,6 @@ import ( ) func TestHealth_ChecksInState(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -60,7 +59,6 @@ func TestHealth_ChecksInState(t *testing.T) { } func TestHealth_ChecksInState_NodeMetaFilter(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -156,7 +154,6 @@ func TestHealth_ChecksInState_NodeMetaFilter(t *testing.T) { } func TestHealth_ChecksInState_DistanceSort(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -234,7 +231,6 @@ func TestHealth_ChecksInState_DistanceSort(t *testing.T) { } func TestHealth_NodeChecks(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -276,7 +272,6 @@ func TestHealth_NodeChecks(t *testing.T) { } func TestHealth_ServiceChecks(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -323,7 +318,6 @@ func TestHealth_ServiceChecks(t *testing.T) { } func TestHealth_ServiceChecks_NodeMetaFilter(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -429,7 +423,6 @@ func TestHealth_ServiceChecks_NodeMetaFilter(t *testing.T) { } func TestHealth_ServiceChecks_DistanceSort(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -518,7 +511,6 @@ func TestHealth_ServiceChecks_DistanceSort(t *testing.T) { } func TestHealth_ServiceNodes(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -602,7 +594,6 @@ func TestHealth_ServiceNodes(t *testing.T) { } func TestHealth_ServiceNodes_NodeMetaFilter(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -733,7 +724,6 @@ func TestHealth_ServiceNodes_NodeMetaFilter(t *testing.T) { } func TestHealth_ServiceNodes_DistanceSort(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -822,7 +812,6 @@ func TestHealth_ServiceNodes_DistanceSort(t *testing.T) { } func TestHealth_NodeChecks_FilterACL(t *testing.T) { - t.Parallel() dir, token, srv, codec := testACLFilterServer(t) defer os.RemoveAll(dir) defer srv.Shutdown() @@ -858,7 +847,6 @@ func TestHealth_NodeChecks_FilterACL(t *testing.T) { } func TestHealth_ServiceChecks_FilterACL(t *testing.T) { - t.Parallel() dir, token, srv, codec := testACLFilterServer(t) defer os.RemoveAll(dir) defer srv.Shutdown() @@ -901,7 +889,6 @@ func TestHealth_ServiceChecks_FilterACL(t *testing.T) { } func TestHealth_ServiceNodes_FilterACL(t *testing.T) { - t.Parallel() dir, token, srv, codec := testACLFilterServer(t) defer os.RemoveAll(dir) defer srv.Shutdown() @@ -937,7 +924,6 @@ func TestHealth_ServiceNodes_FilterACL(t *testing.T) { } func TestHealth_ChecksInState_FilterACL(t *testing.T) { - t.Parallel() dir, token, srv, codec := testACLFilterServer(t) defer os.RemoveAll(dir) defer srv.Shutdown() diff --git a/consul/internal_endpoint_test.go b/consul/internal_endpoint_test.go index 9000aabc2..8b1fc51ac 100644 --- a/consul/internal_endpoint_test.go +++ b/consul/internal_endpoint_test.go @@ -13,7 +13,6 @@ import ( ) func TestInternal_NodeInfo(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -67,7 +66,6 @@ func TestInternal_NodeInfo(t *testing.T) { } func TestInternal_NodeDump(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -159,7 +157,6 @@ func TestInternal_NodeDump(t *testing.T) { } func TestInternal_KeyringOperation(t *testing.T) { - t.Parallel() key1 := "H1dfkSZOVnP/JUnaBfTzXg==" keyBytes1, err := base64.StdEncoding.DecodeString(key1) if err != nil { @@ -242,7 +239,6 @@ func TestInternal_KeyringOperation(t *testing.T) { } func TestInternal_NodeInfo_FilterACL(t *testing.T) { - t.Parallel() dir, token, srv, codec := testACLFilterServer(t) defer os.RemoveAll(dir) defer srv.Shutdown() @@ -293,7 +289,6 @@ func TestInternal_NodeInfo_FilterACL(t *testing.T) { } func TestInternal_NodeDump_FilterACL(t *testing.T) { - t.Parallel() dir, token, srv, codec := testACLFilterServer(t) defer os.RemoveAll(dir) defer srv.Shutdown() @@ -343,7 +338,6 @@ func TestInternal_NodeDump_FilterACL(t *testing.T) { } func TestInternal_EventFire_Token(t *testing.T) { - t.Parallel() dir, srv := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" diff --git a/consul/kvs_endpoint_test.go b/consul/kvs_endpoint_test.go index 33a6fc44c..4acbdfa56 100644 --- a/consul/kvs_endpoint_test.go +++ b/consul/kvs_endpoint_test.go @@ -13,7 +13,6 @@ import ( ) func TestKVS_Apply(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -70,7 +69,6 @@ func TestKVS_Apply(t *testing.T) { } func TestKVS_Apply_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -133,7 +131,6 @@ func TestKVS_Apply_ACLDeny(t *testing.T) { } func TestKVS_Get(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -181,7 +178,6 @@ func TestKVS_Get(t *testing.T) { } func TestKVS_Get_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -227,7 +223,6 @@ func TestKVS_Get_ACLDeny(t *testing.T) { } func TestKVSEndpoint_List(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -299,7 +294,6 @@ func TestKVSEndpoint_List(t *testing.T) { } func TestKVSEndpoint_List_Blocking(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -395,7 +389,6 @@ func TestKVSEndpoint_List_Blocking(t *testing.T) { } func TestKVSEndpoint_List_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -480,7 +473,6 @@ func TestKVSEndpoint_List_ACLDeny(t *testing.T) { } func TestKVSEndpoint_ListKeys(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -550,7 +542,6 @@ func TestKVSEndpoint_ListKeys(t *testing.T) { } func TestKVSEndpoint_ListKeys_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -629,7 +620,6 @@ func TestKVSEndpoint_ListKeys_ACLDeny(t *testing.T) { } func TestKVS_Apply_LockDelay(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -699,7 +689,6 @@ func TestKVS_Apply_LockDelay(t *testing.T) { } func TestKVS_Issue_1626(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() diff --git a/consul/operator_autopilot_endpoint_test.go b/consul/operator_autopilot_endpoint_test.go index 826c7bfbc..80e1eec9b 100644 --- a/consul/operator_autopilot_endpoint_test.go +++ b/consul/operator_autopilot_endpoint_test.go @@ -14,7 +14,6 @@ import ( ) func TestOperator_Autopilot_GetConfiguration(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.AutopilotConfig.CleanupDeadServers = false }) @@ -39,7 +38,6 @@ func TestOperator_Autopilot_GetConfiguration(t *testing.T) { } func TestOperator_Autopilot_GetConfiguration_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -97,7 +95,6 @@ func TestOperator_Autopilot_GetConfiguration_ACLDeny(t *testing.T) { } func TestOperator_Autopilot_SetConfiguration(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.AutopilotConfig.CleanupDeadServers = false }) @@ -133,7 +130,6 @@ func TestOperator_Autopilot_SetConfiguration(t *testing.T) { } func TestOperator_Autopilot_SetConfiguration_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -201,7 +197,6 @@ func TestOperator_Autopilot_SetConfiguration_ACLDeny(t *testing.T) { } func TestOperator_ServerHealth(t *testing.T) { - t.Parallel() conf := func(c *Config) { c.Datacenter = "dc1" c.Bootstrap = false @@ -259,7 +254,6 @@ func TestOperator_ServerHealth(t *testing.T) { } func TestOperator_ServerHealth_UnsupportedRaftVersion(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.Datacenter = "dc1" c.Bootstrap = true diff --git a/consul/operator_raft_endpoint_test.go b/consul/operator_raft_endpoint_test.go index 8df5683bc..169608dd9 100644 --- a/consul/operator_raft_endpoint_test.go +++ b/consul/operator_raft_endpoint_test.go @@ -14,7 +14,6 @@ import ( ) func TestOperator_RaftGetConfiguration(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -57,7 +56,6 @@ func TestOperator_RaftGetConfiguration(t *testing.T) { } func TestOperator_RaftGetConfiguration_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -134,7 +132,6 @@ func TestOperator_RaftGetConfiguration_ACLDeny(t *testing.T) { } func TestOperator_RaftRemovePeerByAddress(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -193,7 +190,6 @@ func TestOperator_RaftRemovePeerByAddress(t *testing.T) { } func TestOperator_RaftRemovePeerByAddress_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -249,7 +245,6 @@ func TestOperator_RaftRemovePeerByAddress_ACLDeny(t *testing.T) { } func TestOperator_RaftRemovePeerByID(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.RaftConfig.ProtocolVersion = 3 }) @@ -310,7 +305,6 @@ func TestOperator_RaftRemovePeerByID(t *testing.T) { } func TestOperator_RaftRemovePeerByID_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" diff --git a/consul/prepared_query_endpoint_test.go b/consul/prepared_query_endpoint_test.go index aa24e6b09..7ca4f51a7 100644 --- a/consul/prepared_query_endpoint_test.go +++ b/consul/prepared_query_endpoint_test.go @@ -21,7 +21,6 @@ import ( ) func TestPreparedQuery_Apply(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -182,7 +181,6 @@ func TestPreparedQuery_Apply(t *testing.T) { } func TestPreparedQuery_Apply_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -464,7 +462,6 @@ func TestPreparedQuery_Apply_ACLDeny(t *testing.T) { } func TestPreparedQuery_Apply_ForwardLeader(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.Bootstrap = false }) @@ -532,7 +529,6 @@ func TestPreparedQuery_Apply_ForwardLeader(t *testing.T) { } func TestPreparedQuery_parseQuery(t *testing.T) { - t.Parallel() query := &structs.PreparedQuery{} err := parseQuery(query, true) @@ -621,7 +617,6 @@ func TestPreparedQuery_parseQuery(t *testing.T) { } func TestPreparedQuery_ACLDeny_Catchall_Template(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -835,7 +830,6 @@ func TestPreparedQuery_ACLDeny_Catchall_Template(t *testing.T) { } func TestPreparedQuery_Get(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -1087,7 +1081,6 @@ func TestPreparedQuery_Get(t *testing.T) { } func TestPreparedQuery_List(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -1294,7 +1287,6 @@ func TestPreparedQuery_List(t *testing.T) { } func TestPreparedQuery_Explain(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -1430,7 +1422,6 @@ func TestPreparedQuery_Explain(t *testing.T) { // walk through the different cases once we have it up. This is broken into // sections so it's still pretty easy to read. func TestPreparedQuery_Execute(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -2452,7 +2443,6 @@ func TestPreparedQuery_Execute(t *testing.T) { } func TestPreparedQuery_Execute_ForwardLeader(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -2581,7 +2571,6 @@ func TestPreparedQuery_Execute_ForwardLeader(t *testing.T) { } func TestPreparedQuery_tagFilter(t *testing.T) { - t.Parallel() testNodes := func() structs.CheckServiceNodes { return structs.CheckServiceNodes{ structs.CheckServiceNode{ @@ -2673,7 +2662,6 @@ func TestPreparedQuery_tagFilter(t *testing.T) { } func TestPreparedQuery_Wrapper(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -2760,7 +2748,6 @@ func (m *mockQueryServer) ForwardDC(method, dc string, args interface{}, reply i } func TestPreparedQuery_queryFailover(t *testing.T) { - t.Parallel() query := &structs.PreparedQuery{ Name: "test", Service: structs.ServiceQuery{ diff --git a/consul/server_test.go b/consul/server_test.go index 74098e38e..471b0b724 100644 --- a/consul/server_test.go +++ b/consul/server_test.go @@ -120,7 +120,6 @@ func testServerWithConfig(t *testing.T, cb func(c *Config)) (string, *Server) { } func TestServer_StartStop(t *testing.T) { - t.Parallel() // Start up a server and then stop it. dir1, s1 := testServer(t) defer os.RemoveAll(dir1) @@ -135,7 +134,6 @@ func TestServer_StartStop(t *testing.T) { } func TestServer_JoinLAN(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -157,7 +155,6 @@ func TestServer_JoinLAN(t *testing.T) { } func TestServer_JoinWAN(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -189,7 +186,6 @@ func TestServer_JoinWAN(t *testing.T) { } func TestServer_JoinWAN_Flood(t *testing.T) { - t.Parallel() // Set up two servers in a WAN. dir1, s1 := testServer(t) defer os.RemoveAll(dir1) @@ -227,7 +223,6 @@ func TestServer_JoinWAN_Flood(t *testing.T) { } func TestServer_JoinSeparateLanAndWanAddresses(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -305,7 +300,6 @@ func TestServer_JoinSeparateLanAndWanAddresses(t *testing.T) { } func TestServer_LeaveLeader(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -341,7 +335,6 @@ func TestServer_LeaveLeader(t *testing.T) { } func TestServer_Leave(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -377,7 +370,6 @@ func TestServer_Leave(t *testing.T) { } func TestServer_RPC(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -389,7 +381,6 @@ func TestServer_RPC(t *testing.T) { } func TestServer_JoinLAN_TLS(t *testing.T) { - t.Parallel() dir1, conf1 := testServerConfig(t, "a.testco.internal") conf1.VerifyIncoming = true conf1.VerifyOutgoing = true @@ -431,7 +422,6 @@ func TestServer_JoinLAN_TLS(t *testing.T) { } func TestServer_Expect(t *testing.T) { - t.Parallel() // All test servers should be in expect=3 mode, except for the 3rd one, // but one with expect=0 can cause a bootstrap to occur from the other // servers as currently implemented. @@ -494,7 +484,6 @@ func TestServer_Expect(t *testing.T) { } func TestServer_BadExpect(t *testing.T) { - t.Parallel() // this one is in expect=3 mode dir1, s1 := testServerDCExpect(t, "dc1", 3) defer os.RemoveAll(dir1) @@ -541,7 +530,6 @@ func (r *fakeGlobalResp) New() interface{} { } func TestServer_globalRPCErrors(t *testing.T) { - t.Parallel() dir1, s1 := testServerDC(t, "dc1") defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -562,7 +550,6 @@ func TestServer_globalRPCErrors(t *testing.T) { } func TestServer_Encrypted(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -610,7 +597,6 @@ func testVerifyRPC(s1, s2 *Server, t *testing.T) (bool, error) { } func TestServer_TLSToNoTLS(t *testing.T) { - t.Parallel() // Set up a server with no TLS configured dir1, s1 := testServer(t) defer os.RemoveAll(dir1) @@ -638,7 +624,6 @@ func TestServer_TLSToNoTLS(t *testing.T) { } func TestServer_TLSForceOutgoingToNoTLS(t *testing.T) { - t.Parallel() // Set up a server with no TLS configured dir1, s1 := testServer(t) defer os.RemoveAll(dir1) @@ -664,7 +649,6 @@ func TestServer_TLSForceOutgoingToNoTLS(t *testing.T) { } func TestServer_TLSToFullVerify(t *testing.T) { - t.Parallel() // Set up a server with TLS and VerifyIncoming set dir1, s1 := testServerWithConfig(t, func(c *Config) { c.CAFile = "../test/client_certs/rootca.crt" diff --git a/consul/session_endpoint_test.go b/consul/session_endpoint_test.go index 99c6e7ec4..f5ca6bb7b 100644 --- a/consul/session_endpoint_test.go +++ b/consul/session_endpoint_test.go @@ -13,7 +13,6 @@ import ( ) func TestSession_Apply(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -73,7 +72,6 @@ func TestSession_Apply(t *testing.T) { } func TestSession_DeleteApply(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -137,7 +135,6 @@ func TestSession_DeleteApply(t *testing.T) { } func TestSession_Apply_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -232,7 +229,6 @@ session "foo" { } func TestSession_Get(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -276,7 +272,6 @@ func TestSession_Get(t *testing.T) { } func TestSession_List(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -328,7 +323,6 @@ func TestSession_List(t *testing.T) { } func TestSession_Get_List_NodeSessions_ACLFilter(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -497,7 +491,6 @@ session "foo" { } func TestSession_ApplyTimers(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -539,7 +532,6 @@ func TestSession_ApplyTimers(t *testing.T) { } func TestSession_Renew(t *testing.T) { - t.Parallel() ttl := 250 * time.Millisecond TTL := ttl.String() @@ -703,7 +695,6 @@ func TestSession_Renew(t *testing.T) { } func TestSession_Renew_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -782,7 +773,6 @@ session "foo" { } func TestSession_NodeSessions(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -841,7 +831,6 @@ func TestSession_NodeSessions(t *testing.T) { } func TestSession_Apply_BadTTL(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() diff --git a/consul/snapshot_endpoint_test.go b/consul/snapshot_endpoint_test.go index 6f69713f7..cb3254f41 100644 --- a/consul/snapshot_endpoint_test.go +++ b/consul/snapshot_endpoint_test.go @@ -147,7 +147,6 @@ func verifySnapshot(t *testing.T, s *Server, dc, token string) { } func TestSnapshot(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -157,7 +156,6 @@ func TestSnapshot(t *testing.T) { } func TestSnapshot_LeaderState(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -240,7 +238,6 @@ func TestSnapshot_LeaderState(t *testing.T) { } func TestSnapshot_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -286,7 +283,6 @@ func TestSnapshot_ACLDeny(t *testing.T) { } func TestSnapshot_Forward_Leader(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.Bootstrap = true }) @@ -313,7 +309,6 @@ func TestSnapshot_Forward_Leader(t *testing.T) { } func TestSnapshot_Forward_Datacenter(t *testing.T) { - t.Parallel() dir1, s1 := testServerDC(t, "dc1") defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -342,7 +337,6 @@ func TestSnapshot_Forward_Datacenter(t *testing.T) { } func TestSnapshot_AllowStale(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.Bootstrap = false }) diff --git a/consul/status_endpoint_test.go b/consul/status_endpoint_test.go index d5b660db3..9f74ac6b4 100644 --- a/consul/status_endpoint_test.go +++ b/consul/status_endpoint_test.go @@ -24,7 +24,6 @@ func rpcClient(t *testing.T, s *Server) rpc.ClientCodec { } func TestStatusLeader(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -51,7 +50,6 @@ func TestStatusLeader(t *testing.T) { } func TestStatusPeers(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() diff --git a/consul/txn_endpoint_test.go b/consul/txn_endpoint_test.go index 0a62707df..d839d26d8 100644 --- a/consul/txn_endpoint_test.go +++ b/consul/txn_endpoint_test.go @@ -15,7 +15,6 @@ import ( ) func TestTxn_CheckNotExists(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -67,7 +66,6 @@ func TestTxn_CheckNotExists(t *testing.T) { } func TestTxn_Apply(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -154,7 +152,6 @@ func TestTxn_Apply(t *testing.T) { } func TestTxn_Apply_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root" @@ -326,7 +323,6 @@ func TestTxn_Apply_ACLDeny(t *testing.T) { } func TestTxn_Apply_LockDelay(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -412,7 +408,6 @@ func TestTxn_Apply_LockDelay(t *testing.T) { } func TestTxn_Read(t *testing.T) { - t.Parallel() dir1, s1 := testServer(t) defer os.RemoveAll(dir1) defer s1.Shutdown() @@ -478,7 +473,6 @@ func TestTxn_Read(t *testing.T) { } func TestTxn_Read_ACLDeny(t *testing.T) { - t.Parallel() dir1, s1 := testServerWithConfig(t, func(c *Config) { c.ACLDatacenter = "dc1" c.ACLMasterToken = "root"