test: run consul tests in parallel

This commit is contained in:
Frank Schroeder 2017-05-23 00:14:27 +02:00
parent ad153f0e76
commit d84e7f9798
No known key found for this signature in database
GPG Key ID: 4D65C6EAEC87DECD
30 changed files with 265 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import (
)
func TestACLEndpoint_Apply(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLMasterToken = "root"
@ -74,6 +75,7 @@ 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"
@ -152,6 +154,7 @@ 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"
@ -199,6 +202,7 @@ 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"
})
@ -225,6 +229,7 @@ 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"
@ -254,6 +259,7 @@ 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"
@ -283,6 +289,7 @@ 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"
@ -330,6 +337,7 @@ 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"
@ -387,6 +395,7 @@ 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"
@ -448,6 +457,7 @@ 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"
})
@ -469,6 +479,7 @@ 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"

View File

@ -16,6 +16,7 @@ import (
)
func TestACLReplication_Sorter(t *testing.T) {
t.Parallel()
acls := structs.ACLs{
&structs.ACL{ID: "a"},
&structs.ACL{ID: "b"},
@ -55,6 +56,7 @@ func TestACLReplication_Sorter(t *testing.T) {
}
func TestACLReplication_Iterator(t *testing.T) {
t.Parallel()
acls := structs.ACLs{}
iter := newACLIterator(acls)
@ -90,6 +92,7 @@ func TestACLReplication_Iterator(t *testing.T) {
}
func TestACLReplication_reconcileACLs(t *testing.T) {
t.Parallel()
parseACLs := func(raw string) structs.ACLs {
var acls structs.ACLs
for _, key := range strings.Split(raw, "|") {
@ -221,6 +224,7 @@ func TestACLReplication_reconcileACLs(t *testing.T) {
}
func TestACLReplication_updateLocalACLs_RateLimit(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.Datacenter = "dc2"
c.ACLDatacenter = "dc1"
@ -270,6 +274,7 @@ func TestACLReplication_updateLocalACLs_RateLimit(t *testing.T) {
}
func TestACLReplication_IsACLReplicationEnabled(t *testing.T) {
t.Parallel()
// ACLs not enabled.
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = ""
@ -318,6 +323,7 @@ func TestACLReplication_IsACLReplicationEnabled(t *testing.T) {
}
func TestACLReplication(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLMasterToken = "root"

View File

@ -23,6 +23,7 @@ key "foo/" {
`
func TestACL_Disabled(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -41,6 +42,7 @@ func TestACL_Disabled(t *testing.T) {
}
func TestACL_ResolveRootACL(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1" // Enable ACLs!
})
@ -65,6 +67,7 @@ func TestACL_ResolveRootACL(t *testing.T) {
}
func TestACL_Authority_NotFound(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1" // Enable ACLs!
})
@ -85,6 +88,7 @@ func TestACL_Authority_NotFound(t *testing.T) {
}
func TestACL_Authority_Found(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1" // Enable ACLs!
c.ACLMasterToken = "root"
@ -131,6 +135,7 @@ func TestACL_Authority_Found(t *testing.T) {
}
func TestACL_Authority_Anonymous_Found(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1" // Enable ACLs!
})
@ -157,6 +162,7 @@ func TestACL_Authority_Anonymous_Found(t *testing.T) {
}
func TestACL_Authority_Master_Found(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1" // Enable ACLs!
c.ACLMasterToken = "foobar"
@ -184,6 +190,7 @@ func TestACL_Authority_Master_Found(t *testing.T) {
}
func TestACL_Authority_Management(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1" // Enable ACLs!
c.ACLMasterToken = "foobar"
@ -212,6 +219,7 @@ func TestACL_Authority_Management(t *testing.T) {
}
func TestACL_NonAuthority_NotFound(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
})
@ -251,6 +259,7 @@ func TestACL_NonAuthority_NotFound(t *testing.T) {
}
func TestACL_NonAuthority_Found(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLMasterToken = "root"
@ -316,6 +325,7 @@ func TestACL_NonAuthority_Found(t *testing.T) {
}
func TestACL_NonAuthority_Management(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1" // Enable ACLs!
c.ACLMasterToken = "foobar"
@ -364,6 +374,7 @@ func TestACL_NonAuthority_Management(t *testing.T) {
}
func TestACL_DownPolicy_Deny(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLDownPolicy = "deny"
@ -429,6 +440,7 @@ func TestACL_DownPolicy_Deny(t *testing.T) {
}
func TestACL_DownPolicy_Allow(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLDownPolicy = "allow"
@ -494,6 +506,7 @@ func TestACL_DownPolicy_Allow(t *testing.T) {
}
func TestACL_DownPolicy_ExtendCache(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLTTL = 0
@ -570,6 +583,7 @@ func TestACL_DownPolicy_ExtendCache(t *testing.T) {
}
func TestACL_Replication(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLMasterToken = "root"
@ -682,6 +696,7 @@ func TestACL_Replication(t *testing.T) {
}
func TestACL_MultiDC_Found(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLMasterToken = "root"
@ -739,6 +754,7 @@ func TestACL_MultiDC_Found(t *testing.T) {
}
func TestACL_filterHealthChecks(t *testing.T) {
t.Parallel()
// Create some health checks.
fill := func() structs.HealthChecks {
return structs.HealthChecks{
@ -830,6 +846,7 @@ node "node1" {
}
func TestACL_filterServices(t *testing.T) {
t.Parallel()
// Create some services
services := structs.Services{
"service1": []string{},
@ -863,6 +880,7 @@ func TestACL_filterServices(t *testing.T) {
}
func TestACL_filterServiceNodes(t *testing.T) {
t.Parallel()
// Create some service nodes.
fill := func() structs.ServiceNodes {
return structs.ServiceNodes{
@ -953,6 +971,7 @@ node "node1" {
}
func TestACL_filterNodeServices(t *testing.T) {
t.Parallel()
// Create some node services.
fill := func() *structs.NodeServices {
return &structs.NodeServices{
@ -1058,6 +1077,7 @@ node "node1" {
}
func TestACL_filterCheckServiceNodes(t *testing.T) {
t.Parallel()
// Create some nodes.
fill := func() structs.CheckServiceNodes {
return structs.CheckServiceNodes{
@ -1169,6 +1189,7 @@ node "node1" {
}
func TestACL_filterCoordinates(t *testing.T) {
t.Parallel()
// Create some coordinates.
coords := structs.Coordinates{
&structs.Coordinate{
@ -1204,6 +1225,7 @@ func TestACL_filterCoordinates(t *testing.T) {
}
func TestACL_filterSessions(t *testing.T) {
t.Parallel()
// Create a session list.
sessions := structs.Sessions{
&structs.Session{
@ -1237,6 +1259,7 @@ func TestACL_filterSessions(t *testing.T) {
}
func TestACL_filterNodeDump(t *testing.T) {
t.Parallel()
// Create a node dump.
fill := func() structs.NodeDump {
return structs.NodeDump{
@ -1363,6 +1386,7 @@ node "node1" {
}
func TestACL_filterNodes(t *testing.T) {
t.Parallel()
// Create a nodes list.
nodes := structs.Nodes{
&structs.Node{
@ -1396,6 +1420,7 @@ func TestACL_filterNodes(t *testing.T) {
}
func TestACL_redactPreparedQueryTokens(t *testing.T) {
t.Parallel()
query := &structs.PreparedQuery{
ID: "f004177f-2c28-83b7-4229-eacc25fe55d1",
Token: "root",
@ -1434,6 +1459,7 @@ func TestACL_redactPreparedQueryTokens(t *testing.T) {
}
func TestACL_filterPreparedQueries(t *testing.T) {
t.Parallel()
queries := structs.PreparedQueries{
&structs.PreparedQuery{
ID: "f004177f-2c28-83b7-4229-eacc25fe55d1",
@ -1501,6 +1527,7 @@ func TestACL_filterPreparedQueries(t *testing.T) {
}
func TestACL_unhandledFilterType(t *testing.T) {
t.Parallel()
defer func(t *testing.T) {
if recover() == nil {
t.Fatalf("should panic")
@ -1518,6 +1545,7 @@ func TestACL_unhandledFilterType(t *testing.T) {
}
func TestACL_vetRegisterWithACL(t *testing.T) {
t.Parallel()
args := &structs.RegisterRequest{
Node: "nope",
Address: "127.0.0.1",
@ -1744,6 +1772,7 @@ node "node" {
}
func TestACL_vetDeregisterWithACL(t *testing.T) {
t.Parallel()
args := &structs.DeregisterRequest{
Node: "nope",
}

View File

@ -12,6 +12,7 @@ import (
)
func TestAutopilot_CleanupDeadServer(t *testing.T) {
t.Parallel()
for i := 1; i <= 3; i++ {
testCleanupDeadServer(t, i)
}
@ -76,6 +77,7 @@ func testCleanupDeadServer(t *testing.T, raftVersion int) {
}
func TestAutopilot_CleanupDeadServerPeriodic(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.Datacenter = "dc1"
c.Bootstrap = true
@ -120,6 +122,7 @@ func TestAutopilot_CleanupDeadServerPeriodic(t *testing.T) {
}
func TestAutopilot_CleanupStaleRaftServer(t *testing.T) {
t.Parallel()
dir1, s1 := testServerDCBootstrap(t, "dc1", true)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -168,6 +171,7 @@ func TestAutopilot_CleanupStaleRaftServer(t *testing.T) {
}
func TestAutopilot_PromoteNonVoter(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.Datacenter = "dc1"
c.Bootstrap = true

View File

@ -18,6 +18,7 @@ import (
)
func TestCatalog_Register(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -47,6 +48,7 @@ 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()
@ -76,6 +78,7 @@ 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()
@ -111,6 +114,7 @@ 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"
@ -212,6 +216,7 @@ service "foo" {
}
func TestCatalog_Register_ForwardLeader(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -255,6 +260,7 @@ 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()
@ -287,6 +293,7 @@ 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()
@ -312,6 +319,7 @@ 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"
@ -523,6 +531,7 @@ service "service" {
}
func TestCatalog_ListDatacenters(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -556,6 +565,7 @@ 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()
@ -594,6 +604,7 @@ 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()
@ -635,6 +646,7 @@ 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()
@ -697,6 +709,7 @@ 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()
@ -761,6 +774,7 @@ 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()
@ -807,6 +821,7 @@ 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()
@ -851,6 +866,7 @@ 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()
@ -941,6 +957,7 @@ 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"
@ -1041,6 +1058,7 @@ 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()
@ -1091,6 +1109,7 @@ 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()
@ -1154,6 +1173,7 @@ 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()
@ -1212,6 +1232,7 @@ 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()
@ -1253,6 +1274,7 @@ 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()
@ -1290,6 +1312,7 @@ 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()
@ -1339,6 +1362,7 @@ 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()
@ -1439,6 +1463,7 @@ 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()
@ -1526,6 +1551,7 @@ 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()
@ -1576,6 +1602,7 @@ 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()
@ -1695,6 +1722,7 @@ service "foo" {
}
func TestCatalog_ListServices_FilterACL(t *testing.T) {
t.Parallel()
dir, token, srv, codec := testACLFilterServer(t)
defer os.RemoveAll(dir)
defer srv.Shutdown()
@ -1717,6 +1745,7 @@ 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()
@ -1766,6 +1795,7 @@ 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"
@ -1841,6 +1871,7 @@ node "%s" {
}
func TestCatalog_NodeServices_FilterACL(t *testing.T) {
t.Parallel()
dir, token, srv, codec := testACLFilterServer(t)
defer os.RemoveAll(dir)
defer srv.Shutdown()

View File

@ -63,6 +63,7 @@ func testClientWithConfig(t *testing.T, cb func(c *Config)) (string, *Client) {
}
func TestClient_StartStop(t *testing.T) {
t.Parallel()
dir, client := testClient(t)
defer os.RemoveAll(dir)
@ -72,6 +73,7 @@ func TestClient_StartStop(t *testing.T) {
}
func TestClient_JoinLAN(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -96,6 +98,7 @@ func TestClient_JoinLAN(t *testing.T) {
}
func TestClient_JoinLAN_Invalid(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -119,6 +122,7 @@ func TestClient_JoinLAN_Invalid(t *testing.T) {
}
func TestClient_JoinWAN_Invalid(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -142,6 +146,7 @@ func TestClient_JoinWAN_Invalid(t *testing.T) {
}
func TestClient_RPC(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -177,6 +182,7 @@ func TestClient_RPC(t *testing.T) {
}
func TestClient_RPC_Pool(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -219,6 +225,7 @@ func TestClient_RPC_Pool(t *testing.T) {
}
func TestClient_RPC_ConsulServerPing(t *testing.T) {
t.Parallel()
var servers []*Server
var serverDirs []string
const numServers = 5
@ -282,6 +289,7 @@ func TestClient_RPC_ConsulServerPing(t *testing.T) {
}
func TestClient_RPC_TLS(t *testing.T) {
t.Parallel()
dir1, conf1 := testServerConfig(t, "a.testco.internal")
conf1.VerifyIncoming = true
conf1.VerifyOutgoing = true
@ -327,6 +335,7 @@ func TestClient_RPC_TLS(t *testing.T) {
}
func TestClient_SnapshotRPC(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -369,6 +378,7 @@ func TestClient_SnapshotRPC(t *testing.T) {
}
func TestClient_SnapshotRPC_TLS(t *testing.T) {
t.Parallel()
dir1, conf1 := testServerConfig(t, "a.testco.internal")
conf1.VerifyIncoming = true
conf1.VerifyOutgoing = true
@ -424,6 +434,7 @@ func TestClient_SnapshotRPC_TLS(t *testing.T) {
}
func TestClientServer_UserEvent(t *testing.T) {
t.Parallel()
clientOut := make(chan serf.UserEvent, 2)
dir1, c1 := testClientWithConfig(t, func(conf *Config) {
conf.UserEventHandler = func(e serf.UserEvent) {
@ -500,6 +511,7 @@ func TestClientServer_UserEvent(t *testing.T) {
}
func TestClient_Encrypted(t *testing.T) {
t.Parallel()
dir1, c1 := testClient(t)
defer os.RemoveAll(dir1)
defer c1.Shutdown()

View File

@ -5,6 +5,7 @@ import (
)
func TestConfig_GetTokenForAgent(t *testing.T) {
t.Parallel()
config := DefaultConfig()
if token := config.GetTokenForAgent(); token != "" {
t.Fatalf("bad: %s", token)

View File

@ -42,6 +42,7 @@ 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)
@ -198,6 +199,7 @@ 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"
@ -279,6 +281,7 @@ node "node1" {
}
func TestCoordinate_ListDatacenters(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -309,6 +312,7 @@ 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()
@ -381,6 +385,7 @@ 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"

View File

@ -9,6 +9,7 @@ import (
)
func TestFilter_DirEnt(t *testing.T) {
t.Parallel()
policy, _ := acl.Parse(testFilterRules)
aclR, _ := acl.New(acl.DenyAll(), policy)
@ -50,6 +51,7 @@ func TestFilter_DirEnt(t *testing.T) {
}
func TestFilter_Keys(t *testing.T) {
t.Parallel()
policy, _ := acl.Parse(testFilterRules)
aclR, _ := acl.New(acl.DenyAll(), policy)
@ -81,6 +83,7 @@ func TestFilter_Keys(t *testing.T) {
}
func TestFilter_TxnResults(t *testing.T) {
t.Parallel()
policy, _ := acl.Parse(testFilterRules)
aclR, _ := acl.New(acl.DenyAll(), policy)

View File

@ -54,6 +54,7 @@ func generateUUID() (ret string) {
}
func TestFSM_RegisterNode(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -97,6 +98,7 @@ func TestFSM_RegisterNode(t *testing.T) {
}
func TestFSM_RegisterNode_Service(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -159,6 +161,7 @@ func TestFSM_RegisterNode_Service(t *testing.T) {
}
func TestFSM_DeregisterService(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -220,6 +223,7 @@ func TestFSM_DeregisterService(t *testing.T) {
}
func TestFSM_DeregisterCheck(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -281,6 +285,7 @@ func TestFSM_DeregisterCheck(t *testing.T) {
}
func TestFSM_DeregisterNode(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -357,6 +362,7 @@ func TestFSM_DeregisterNode(t *testing.T) {
}
func TestFSM_SnapshotRestore(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -614,6 +620,7 @@ func TestFSM_SnapshotRestore(t *testing.T) {
}
func TestFSM_BadRestore(t *testing.T) {
t.Parallel()
// Create an FSM with some state.
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
@ -652,6 +659,7 @@ func TestFSM_BadRestore(t *testing.T) {
}
func TestFSM_KVSDelete(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -697,6 +705,7 @@ func TestFSM_KVSDelete(t *testing.T) {
}
func TestFSM_KVSDeleteTree(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -743,6 +752,7 @@ func TestFSM_KVSDeleteTree(t *testing.T) {
}
func TestFSM_KVSDeleteCheckAndSet(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -798,6 +808,7 @@ func TestFSM_KVSDeleteCheckAndSet(t *testing.T) {
}
func TestFSM_KVSCheckAndSet(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -854,6 +865,7 @@ func TestFSM_KVSCheckAndSet(t *testing.T) {
}
func TestFSM_CoordinateUpdate(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -894,6 +906,7 @@ func TestFSM_CoordinateUpdate(t *testing.T) {
}
func TestFSM_SessionCreate_Destroy(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -973,6 +986,7 @@ func TestFSM_SessionCreate_Destroy(t *testing.T) {
}
func TestFSM_KVSLock(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -1017,6 +1031,7 @@ func TestFSM_KVSLock(t *testing.T) {
}
func TestFSM_KVSUnlock(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -1079,6 +1094,7 @@ func TestFSM_KVSUnlock(t *testing.T) {
}
func TestFSM_ACL_Set_Delete(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -1151,6 +1167,7 @@ func TestFSM_ACL_Set_Delete(t *testing.T) {
}
func TestFSM_PreparedQuery_CRUD(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -1248,6 +1265,7 @@ func TestFSM_PreparedQuery_CRUD(t *testing.T) {
}
func TestFSM_TombstoneReap(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -1295,6 +1313,7 @@ func TestFSM_TombstoneReap(t *testing.T) {
}
func TestFSM_Txn(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -1336,6 +1355,7 @@ func TestFSM_Txn(t *testing.T) {
}
func TestFSM_Autopilot(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)
@ -1397,6 +1417,7 @@ func TestFSM_Autopilot(t *testing.T) {
}
func TestFSM_IgnoreUnknown(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)

View File

@ -13,6 +13,7 @@ import (
)
func TestHealth_ChecksInState(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -59,6 +60,7 @@ 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()
@ -154,6 +156,7 @@ 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()
@ -231,6 +234,7 @@ 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()
@ -272,6 +276,7 @@ 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()
@ -318,6 +323,7 @@ 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()
@ -423,6 +429,7 @@ 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()
@ -511,6 +518,7 @@ 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()
@ -594,6 +602,7 @@ 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()
@ -724,6 +733,7 @@ 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()
@ -812,6 +822,7 @@ 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()
@ -847,6 +858,7 @@ 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()
@ -889,6 +901,7 @@ 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()
@ -924,6 +937,7 @@ 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()

View File

@ -13,6 +13,7 @@ import (
)
func TestInternal_NodeInfo(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -66,6 +67,7 @@ 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()
@ -157,6 +159,7 @@ 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 {
@ -239,6 +242,7 @@ 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()
@ -289,6 +293,7 @@ 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()
@ -338,6 +343,7 @@ 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"

View File

@ -11,6 +11,7 @@ import (
// Testing for GH-300 and GH-279
func TestHealthCheckRace(t *testing.T) {
t.Parallel()
fsm, err := NewFSM(nil, os.Stderr)
if err != nil {
t.Fatalf("err: %v", err)

View File

@ -13,6 +13,7 @@ import (
)
func TestKVS_Apply(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -69,6 +70,7 @@ 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"
@ -131,6 +133,7 @@ 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()
@ -178,6 +181,7 @@ 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"
@ -223,6 +227,7 @@ 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()
@ -294,6 +299,7 @@ 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()
@ -389,6 +395,7 @@ 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"
@ -473,6 +480,7 @@ 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()
@ -542,6 +550,7 @@ 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"
@ -620,6 +629,7 @@ 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()
@ -689,6 +699,7 @@ 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()

View File

@ -14,6 +14,7 @@ import (
)
func TestLeader_RegisterMember(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLMasterToken = "root"
@ -82,6 +83,7 @@ func TestLeader_RegisterMember(t *testing.T) {
}
func TestLeader_FailedMember(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLMasterToken = "root"
@ -142,6 +144,7 @@ func TestLeader_FailedMember(t *testing.T) {
}
func TestLeader_LeftMember(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLMasterToken = "root"
@ -187,6 +190,7 @@ func TestLeader_LeftMember(t *testing.T) {
})
}
func TestLeader_ReapMember(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLMasterToken = "root"
@ -247,6 +251,7 @@ func TestLeader_ReapMember(t *testing.T) {
}
func TestLeader_Reconcile_ReapMember(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLMasterToken = "root"
@ -295,6 +300,7 @@ func TestLeader_Reconcile_ReapMember(t *testing.T) {
}
func TestLeader_Reconcile(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLMasterToken = "root"
@ -334,6 +340,7 @@ func TestLeader_Reconcile(t *testing.T) {
}
func TestLeader_Reconcile_Races(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -423,6 +430,7 @@ func TestLeader_Reconcile_Races(t *testing.T) {
}
func TestLeader_LeftServer(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -460,6 +468,7 @@ func TestLeader_LeftServer(t *testing.T) {
}
func TestLeader_LeftLeader(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -519,6 +528,7 @@ func TestLeader_LeftLeader(t *testing.T) {
}
func TestLeader_MultiBootstrap(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -550,6 +560,7 @@ func TestLeader_MultiBootstrap(t *testing.T) {
}
func TestLeader_TombstoneGC_Reset(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -611,6 +622,7 @@ func TestLeader_TombstoneGC_Reset(t *testing.T) {
}
func TestLeader_ReapTombstones(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = "dc1"
c.ACLMasterToken = "root"
@ -680,6 +692,7 @@ func TestLeader_ReapTombstones(t *testing.T) {
}
func TestLeader_RollRaftServer(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.Bootstrap = true
c.Datacenter = "dc1"
@ -762,6 +775,7 @@ func TestLeader_RollRaftServer(t *testing.T) {
}
func TestLeader_ChangeServerID(t *testing.T) {
t.Parallel()
conf := func(c *Config) {
c.Bootstrap = false
c.BootstrapExpect = 3

View File

@ -32,6 +32,7 @@ func makeNode(dc, name, id string, server bool) *serf.Member {
}
func TestMerge_LAN(t *testing.T) {
t.Parallel()
cases := []struct {
members []*serf.Member
expect string
@ -115,6 +116,7 @@ func TestMerge_LAN(t *testing.T) {
}
func TestMerge_WAN(t *testing.T) {
t.Parallel()
cases := []struct {
members []*serf.Member
expect string

View File

@ -14,6 +14,7 @@ import (
)
func TestOperator_Autopilot_GetConfiguration(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.AutopilotConfig.CleanupDeadServers = false
})
@ -38,6 +39,7 @@ 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"
@ -95,6 +97,7 @@ 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
})
@ -130,6 +133,7 @@ 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"
@ -197,6 +201,7 @@ 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
@ -254,6 +259,7 @@ 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

View File

@ -14,6 +14,7 @@ import (
)
func TestOperator_RaftGetConfiguration(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -56,6 +57,7 @@ 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"
@ -132,6 +134,7 @@ 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()
@ -190,6 +193,7 @@ 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"
@ -245,6 +249,7 @@ 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
})
@ -305,6 +310,7 @@ 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"

View File

@ -21,6 +21,7 @@ import (
)
func TestPreparedQuery_Apply(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -181,6 +182,7 @@ 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"
@ -462,6 +464,7 @@ 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
})
@ -529,6 +532,7 @@ func TestPreparedQuery_Apply_ForwardLeader(t *testing.T) {
}
func TestPreparedQuery_parseQuery(t *testing.T) {
t.Parallel()
query := &structs.PreparedQuery{}
err := parseQuery(query, true)
@ -617,6 +621,7 @@ 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"
@ -830,6 +835,7 @@ 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"
@ -1081,6 +1087,7 @@ 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"
@ -1287,6 +1294,7 @@ 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"
@ -1422,6 +1430,7 @@ 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"
@ -2443,6 +2452,7 @@ 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()
@ -2571,6 +2581,7 @@ func TestPreparedQuery_Execute_ForwardLeader(t *testing.T) {
}
func TestPreparedQuery_tagFilter(t *testing.T) {
t.Parallel()
testNodes := func() structs.CheckServiceNodes {
return structs.CheckServiceNodes{
structs.CheckServiceNode{
@ -2662,6 +2673,7 @@ 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"
@ -2748,6 +2760,7 @@ 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{

View File

@ -14,6 +14,7 @@ import (
)
func TestRPC_NoLeader_Fail(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.RPCHoldTimeout = 1 * time.Millisecond
})
@ -45,6 +46,7 @@ func TestRPC_NoLeader_Fail(t *testing.T) {
}
func TestRPC_NoLeader_Retry(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.RPCHoldTimeout = 10 * time.Second
})
@ -75,6 +77,7 @@ func TestRPC_NoLeader_Retry(t *testing.T) {
}
func TestRPC_blockingQuery(t *testing.T) {
t.Parallel()
dir, s := testServer(t)
defer os.RemoveAll(dir)
defer s.Shutdown()

View File

@ -131,6 +131,7 @@ func seedCoordinates(t *testing.T, codec rpc.ClientCodec, server *Server) {
}
func TestRTT_sortNodesByDistanceFrom(t *testing.T) {
t.Parallel()
dir, server := testServer(t)
defer os.RemoveAll(dir)
defer server.Shutdown()
@ -183,6 +184,7 @@ func TestRTT_sortNodesByDistanceFrom(t *testing.T) {
}
func TestRTT_sortNodesByDistanceFrom_Nodes(t *testing.T) {
t.Parallel()
dir, server := testServer(t)
defer os.RemoveAll(dir)
defer server.Shutdown()
@ -232,6 +234,7 @@ func TestRTT_sortNodesByDistanceFrom_Nodes(t *testing.T) {
}
func TestRTT_sortNodesByDistanceFrom_ServiceNodes(t *testing.T) {
t.Parallel()
dir, server := testServer(t)
defer os.RemoveAll(dir)
defer server.Shutdown()
@ -281,6 +284,7 @@ func TestRTT_sortNodesByDistanceFrom_ServiceNodes(t *testing.T) {
}
func TestRTT_sortNodesByDistanceFrom_HealthChecks(t *testing.T) {
t.Parallel()
dir, server := testServer(t)
defer os.RemoveAll(dir)
defer server.Shutdown()
@ -330,6 +334,7 @@ func TestRTT_sortNodesByDistanceFrom_HealthChecks(t *testing.T) {
}
func TestRTT_sortNodesByDistanceFrom_CheckServiceNodes(t *testing.T) {
t.Parallel()
dir, server := testServer(t)
defer os.RemoveAll(dir)
defer server.Shutdown()

View File

@ -5,6 +5,7 @@ import (
)
func TestUserEventNames(t *testing.T) {
t.Parallel()
out := userEventName("foo")
if out != "consul:event:foo" {
t.Fatalf("bad: %v", out)

View File

@ -122,6 +122,7 @@ 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)
@ -136,6 +137,7 @@ 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,6 +159,7 @@ 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()
@ -188,6 +191,7 @@ 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)
@ -225,6 +229,7 @@ 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()
@ -302,6 +307,7 @@ 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()
@ -337,6 +343,7 @@ 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()
@ -372,6 +379,7 @@ 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()
@ -383,6 +391,7 @@ 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
@ -424,6 +433,7 @@ 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.
@ -486,6 +496,7 @@ 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)
@ -532,6 +543,7 @@ 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()
@ -552,6 +564,7 @@ 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()
@ -596,6 +609,7 @@ 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)
@ -623,6 +637,7 @@ 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)
@ -648,6 +663,7 @@ 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"

View File

@ -13,6 +13,7 @@ import (
)
func TestSession_Apply(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -72,6 +73,7 @@ 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()
@ -135,6 +137,7 @@ 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"
@ -229,6 +232,7 @@ session "foo" {
}
func TestSession_Get(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -272,6 +276,7 @@ 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()
@ -323,6 +328,7 @@ 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"
@ -491,6 +497,7 @@ session "foo" {
}
func TestSession_ApplyTimers(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -532,6 +539,7 @@ func TestSession_ApplyTimers(t *testing.T) {
}
func TestSession_Renew(t *testing.T) {
t.Parallel()
ttl := 250 * time.Millisecond
TTL := ttl.String()
@ -695,6 +703,7 @@ 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"
@ -773,6 +782,7 @@ session "foo" {
}
func TestSession_NodeSessions(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -831,6 +841,7 @@ 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()

View File

@ -13,6 +13,7 @@ import (
)
func TestInitializeSessionTimers(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -46,6 +47,7 @@ func TestInitializeSessionTimers(t *testing.T) {
}
func TestResetSessionTimer_Fault(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -86,6 +88,7 @@ func TestResetSessionTimer_Fault(t *testing.T) {
}
func TestResetSessionTimer_NoTTL(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -120,6 +123,7 @@ func TestResetSessionTimer_NoTTL(t *testing.T) {
}
func TestResetSessionTimer_InvalidTTL(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -139,6 +143,7 @@ func TestResetSessionTimer_InvalidTTL(t *testing.T) {
}
func TestResetSessionTimerLocked(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -161,6 +166,7 @@ func TestResetSessionTimerLocked(t *testing.T) {
}
func TestResetSessionTimerLocked_Renew(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -201,6 +207,7 @@ func TestResetSessionTimerLocked_Renew(t *testing.T) {
}
func TestInvalidateSession(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -235,6 +242,7 @@ func TestInvalidateSession(t *testing.T) {
}
func TestClearSessionTimer(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -254,6 +262,7 @@ func TestClearSessionTimer(t *testing.T) {
}
func TestClearAllSessionTimers(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -275,6 +284,7 @@ func TestClearAllSessionTimers(t *testing.T) {
}
func TestServer_SessionTTL_Failover(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()

View File

@ -147,6 +147,7 @@ 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()
@ -156,6 +157,7 @@ func TestSnapshot(t *testing.T) {
}
func TestSnapshot_LeaderState(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -238,6 +240,7 @@ 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"
@ -283,6 +286,7 @@ 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
})
@ -309,6 +313,7 @@ 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()
@ -337,6 +342,7 @@ 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
})

View File

@ -12,6 +12,7 @@ import (
)
func TestStatsFetcher(t *testing.T) {
t.Parallel()
dir1, s1 := testServerDCExpect(t, "dc1", 3)
defer os.RemoveAll(dir1)
defer s1.Shutdown()

View File

@ -24,6 +24,7 @@ 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()
@ -50,6 +51,7 @@ func TestStatusLeader(t *testing.T) {
}
func TestStatusPeers(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()

View File

@ -15,6 +15,7 @@ import (
)
func TestTxn_CheckNotExists(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -66,6 +67,7 @@ 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()
@ -152,6 +154,7 @@ 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"
@ -323,6 +326,7 @@ 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()
@ -408,6 +412,7 @@ 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()
@ -473,6 +478,7 @@ 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"

View File

@ -12,6 +12,7 @@ import (
)
func TestGetPrivateIP(t *testing.T) {
t.Parallel()
ip, _, err := net.ParseCIDR("10.1.2.3/32")
if err != nil {
t.Fatalf("failed to parse private cidr: %v", err)
@ -80,6 +81,7 @@ func TestGetPrivateIP(t *testing.T) {
}
func TestIsPrivateIP(t *testing.T) {
t.Parallel()
if !isPrivateIP("192.168.1.1") {
t.Fatalf("bad")
}
@ -101,6 +103,7 @@ func TestIsPrivateIP(t *testing.T) {
}
func TestUtil_CanServersUnderstandProtocol(t *testing.T) {
t.Parallel()
var members []serf.Member
// All empty list cases should return false.
@ -198,6 +201,7 @@ func TestUtil_CanServersUnderstandProtocol(t *testing.T) {
}
func TestIsConsulNode(t *testing.T) {
t.Parallel()
m := serf.Member{
Tags: map[string]string{
"role": "node",
@ -211,6 +215,7 @@ func TestIsConsulNode(t *testing.T) {
}
func TestByteConversion(t *testing.T) {
t.Parallel()
var val uint64 = 2 << 50
raw := uint64ToBytes(val)
if bytesToUint64(raw) != val {
@ -219,6 +224,7 @@ func TestByteConversion(t *testing.T) {
}
func TestGenerateUUID(t *testing.T) {
t.Parallel()
prev := generateUUID()
for i := 0; i < 100; i++ {
id := generateUUID()
@ -235,6 +241,7 @@ func TestGenerateUUID(t *testing.T) {
}
func TestGetPublicIPv6(t *testing.T) {
t.Parallel()
ip, _, err := net.ParseCIDR("fe80::1/128")
if err != nil {
t.Fatalf("failed to parse link-local cidr: %v", err)
@ -328,6 +335,7 @@ func TestGetPublicIPv6(t *testing.T) {
}
func TestServersMeetMinimumVersion(t *testing.T) {
t.Parallel()
makeMember := func(version string) serf.Member {
return serf.Member{
Name: "foo",