rpc: run agent/consul tests in parallel

This commit is contained in:
Frank Schroeder 2017-06-27 15:22:18 +02:00 committed by Frank Schröder
parent b3189a566a
commit 50c81a9397
23 changed files with 216 additions and 9 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

@ -224,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"
@ -273,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 = ""
@ -321,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"

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_StaleRead(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -761,6 +774,7 @@ func TestCatalog_ListNodes_StaleRead(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

@ -62,6 +62,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)
@ -71,6 +72,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()
@ -95,6 +97,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()
@ -118,6 +121,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()
@ -141,6 +145,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()
@ -176,6 +181,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()
@ -218,6 +224,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
@ -281,6 +288,7 @@ func TestClient_RPC_ConsulServerPing(t *testing.T) {
}
func TestClient_RPC_TLS(t *testing.T) {
t.Parallel()
dir1, conf1 := testServerConfig(t)
conf1.VerifyIncoming = true
conf1.VerifyOutgoing = true
@ -326,6 +334,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()
@ -368,6 +377,7 @@ func TestClient_SnapshotRPC(t *testing.T) {
}
func TestClient_SnapshotRPC_TLS(t *testing.T) {
t.Parallel()
dir1, conf1 := testServerConfig(t)
conf1.VerifyIncoming = true
conf1.VerifyOutgoing = true
@ -423,6 +433,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) {
@ -499,6 +510,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

@ -42,16 +42,13 @@ func verifyCoordinatesEqual(t *testing.T, a, b *coordinate.Coordinate) {
}
func TestCoordinate_Update(t *testing.T) {
dir1, config1 := testServerConfig(t)
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.CoordinateUpdatePeriod = 500 * time.Millisecond
c.CoordinateUpdateBatchSize = 5
c.CoordinateUpdateMaxBatches = 2
})
defer os.RemoveAll(dir1)
config1.CoordinateUpdatePeriod = 500 * time.Millisecond
config1.CoordinateUpdateBatchSize = 5
config1.CoordinateUpdateMaxBatches = 2
s1, err := NewServer(config1)
if err != nil {
t.Fatal(err)
}
defer s1.Shutdown()
codec := rpcClient(t, s1)
@ -197,6 +194,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"
@ -278,6 +276,7 @@ node "node1" {
}
func TestCoordinate_ListDatacenters(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -308,6 +307,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()
@ -380,6 +380,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

@ -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

@ -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()
@ -525,6 +534,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()
@ -556,6 +566,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()
@ -617,6 +628,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"
@ -686,6 +698,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"
@ -768,6 +781,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

@ -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

@ -15,6 +15,7 @@ import (
)
func TestRPC_NoLeader_Fail(t *testing.T) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.RPCHoldTimeout = 1 * time.Millisecond
})
@ -46,6 +47,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
})
@ -76,6 +78,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

@ -169,6 +169,7 @@ func newServer(c *Config) (*Server, error) {
}
func TestServer_StartStop(t *testing.T) {
t.Parallel()
// Start up a server and then stop it.
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
@ -183,6 +184,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()
@ -204,6 +206,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()
@ -235,6 +238,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 := testServerDCBootstrap(t, "dc1", true)
defer os.RemoveAll(dir1)
@ -272,6 +276,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()
@ -349,6 +354,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()
@ -386,6 +392,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()
@ -423,6 +430,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()
@ -434,6 +442,7 @@ func TestServer_RPC(t *testing.T) {
}
func TestServer_JoinLAN_TLS(t *testing.T) {
t.Parallel()
dir1, conf1 := testServerConfig(t)
conf1.VerifyIncoming = true
conf1.VerifyOutgoing = true
@ -475,6 +484,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.
@ -537,6 +547,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)
@ -583,6 +594,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()
@ -603,6 +615,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()
@ -651,6 +664,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)
@ -678,6 +692,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)
@ -703,6 +718,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 := time.Second
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()
@ -45,6 +46,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()
@ -84,6 +86,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()
@ -117,6 +120,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()
@ -136,6 +140,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()
@ -154,6 +159,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()
@ -252,6 +260,7 @@ func TestClearSessionTimer(t *testing.T) {
}
func TestClearAllSessionTimers(t *testing.T) {
t.Parallel()
dir1, s1 := testServer(t)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
@ -272,6 +281,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

@ -25,6 +25,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()
@ -51,6 +52,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"