From 565cac0340bd9641f2a3074aa718e35c6ba228f1 Mon Sep 17 00:00:00 2001 From: Ryan Uber Date: Fri, 8 May 2015 10:27:24 -0700 Subject: [PATCH] api: run tests in parallel --- api/acl_test.go | 4 ++++ api/agent_test.go | 12 ++++++++++++ api/api_test.go | 6 ++++++ api/catalog_test.go | 6 ++++++ api/event_test.go | 1 + api/health_test.go | 4 ++++ api/kv_test.go | 8 ++++++++ api/lock_test.go | 7 +++++++ api/semaphore_test.go | 7 +++++++ api/session_test.go | 5 +++++ api/status_test.go | 2 ++ 11 files changed, 62 insertions(+) diff --git a/api/acl_test.go b/api/acl_test.go index 1e9641795a..b896a18957 100644 --- a/api/acl_test.go +++ b/api/acl_test.go @@ -13,6 +13,7 @@ func init() { } func TestACL_CreateDestroy(t *testing.T) { + t.Parallel() if CONSUL_ROOT == "" { t.SkipNow() } @@ -61,6 +62,7 @@ func TestACL_CreateDestroy(t *testing.T) { } func TestACL_CloneDestroy(t *testing.T) { + t.Parallel() if CONSUL_ROOT == "" { t.SkipNow() } @@ -94,6 +96,7 @@ func TestACL_CloneDestroy(t *testing.T) { } func TestACL_Info(t *testing.T) { + t.Parallel() if CONSUL_ROOT == "" { t.SkipNow() } @@ -121,6 +124,7 @@ func TestACL_Info(t *testing.T) { } func TestACL_List(t *testing.T) { + t.Parallel() if CONSUL_ROOT == "" { t.SkipNow() } diff --git a/api/agent_test.go b/api/agent_test.go index 5498420921..dbd43f2d37 100644 --- a/api/agent_test.go +++ b/api/agent_test.go @@ -6,6 +6,7 @@ import ( ) func TestAgent_Self(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -23,6 +24,7 @@ func TestAgent_Self(t *testing.T) { } func TestAgent_Members(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -39,6 +41,7 @@ func TestAgent_Members(t *testing.T) { } func TestAgent_Services(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -78,6 +81,7 @@ func TestAgent_Services(t *testing.T) { } func TestAgent_ServiceAddress(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -124,6 +128,7 @@ func TestAgent_ServiceAddress(t *testing.T) { } func TestAgent_Services_MultipleChecks(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -167,6 +172,7 @@ func TestAgent_Services_MultipleChecks(t *testing.T) { } func TestAgent_SetTTLStatus(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -207,6 +213,7 @@ func TestAgent_SetTTLStatus(t *testing.T) { } func TestAgent_Checks(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -234,6 +241,7 @@ func TestAgent_Checks(t *testing.T) { } func TestAgent_Checks_serviceBound(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -272,6 +280,7 @@ func TestAgent_Checks_serviceBound(t *testing.T) { } func TestAgent_Join(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -291,6 +300,7 @@ func TestAgent_Join(t *testing.T) { } func TestAgent_ForceLeave(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -304,6 +314,7 @@ func TestAgent_ForceLeave(t *testing.T) { } func TestServiceMaintenance(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -358,6 +369,7 @@ func TestServiceMaintenance(t *testing.T) { } func TestNodeMaintenance(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() diff --git a/api/api_test.go b/api/api_test.go index 9c86e17aea..283ebe358b 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -59,6 +59,7 @@ func testKey() string { } func TestDefaultConfig_env(t *testing.T) { + t.Parallel() addr := "1.2.3.4:5678" token := "abcd1234" auth := "username:password" @@ -104,6 +105,7 @@ func TestDefaultConfig_env(t *testing.T) { } func TestSetQueryOptions(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -139,6 +141,7 @@ func TestSetQueryOptions(t *testing.T) { } func TestSetWriteOptions(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -158,6 +161,7 @@ func TestSetWriteOptions(t *testing.T) { } func TestRequestToHTTP(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -180,6 +184,7 @@ func TestRequestToHTTP(t *testing.T) { } func TestParseQueryMeta(t *testing.T) { + t.Parallel() resp := &http.Response{ Header: make(map[string][]string), } @@ -204,6 +209,7 @@ func TestParseQueryMeta(t *testing.T) { } func TestAPI_UnixSocket(t *testing.T) { + t.Parallel() if runtime.GOOS == "windows" { t.SkipNow() } diff --git a/api/catalog_test.go b/api/catalog_test.go index a0b950e5fb..bb8be25b00 100644 --- a/api/catalog_test.go +++ b/api/catalog_test.go @@ -8,6 +8,7 @@ import ( ) func TestCatalog_Datacenters(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -30,6 +31,7 @@ func TestCatalog_Datacenters(t *testing.T) { } func TestCatalog_Nodes(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -56,6 +58,7 @@ func TestCatalog_Nodes(t *testing.T) { } func TestCatalog_Services(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -82,6 +85,7 @@ func TestCatalog_Services(t *testing.T) { } func TestCatalog_Service(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -108,6 +112,7 @@ func TestCatalog_Service(t *testing.T) { } func TestCatalog_Node(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -134,6 +139,7 @@ func TestCatalog_Node(t *testing.T) { } func TestCatalog_Registration(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() diff --git a/api/event_test.go b/api/event_test.go index 9ebcb5397d..b37c24924c 100644 --- a/api/event_test.go +++ b/api/event_test.go @@ -5,6 +5,7 @@ import ( ) func TestEvent_FireList(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() diff --git a/api/health_test.go b/api/health_test.go index df6eb0f666..d80a4693ae 100644 --- a/api/health_test.go +++ b/api/health_test.go @@ -8,6 +8,7 @@ import ( ) func TestHealth_Node(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -38,6 +39,7 @@ func TestHealth_Node(t *testing.T) { } func TestHealth_Checks(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -74,6 +76,7 @@ func TestHealth_Checks(t *testing.T) { } func TestHealth_Service(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -98,6 +101,7 @@ func TestHealth_Service(t *testing.T) { } func TestHealth_State(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() diff --git a/api/kv_test.go b/api/kv_test.go index a5a0b54e22..346d136814 100644 --- a/api/kv_test.go +++ b/api/kv_test.go @@ -8,6 +8,7 @@ import ( ) func TestClientPutGetDelete(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -64,6 +65,7 @@ func TestClientPutGetDelete(t *testing.T) { } func TestClient_List_DeleteRecurse(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -118,6 +120,7 @@ func TestClient_List_DeleteRecurse(t *testing.T) { } func TestClient_DeleteCAS(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -163,6 +166,7 @@ func TestClient_DeleteCAS(t *testing.T) { } func TestClient_CAS(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -210,6 +214,7 @@ func TestClient_CAS(t *testing.T) { } func TestClient_WatchGet(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -261,6 +266,7 @@ func TestClient_WatchGet(t *testing.T) { } func TestClient_WatchList(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -314,6 +320,7 @@ func TestClient_WatchList(t *testing.T) { } func TestClient_Keys_DeleteRecurse(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -363,6 +370,7 @@ func TestClient_Keys_DeleteRecurse(t *testing.T) { } func TestClient_AcquireRelease(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() diff --git a/api/lock_test.go b/api/lock_test.go index 163372fe4a..0a8fa5172a 100644 --- a/api/lock_test.go +++ b/api/lock_test.go @@ -8,6 +8,7 @@ import ( ) func TestLock_LockUnlock(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -65,6 +66,7 @@ func TestLock_LockUnlock(t *testing.T) { } func TestLock_ForceInvalidate(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -99,6 +101,7 @@ func TestLock_ForceInvalidate(t *testing.T) { } func TestLock_DeleteKey(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -132,6 +135,7 @@ func TestLock_DeleteKey(t *testing.T) { } func TestLock_Contend(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -184,6 +188,7 @@ func TestLock_Contend(t *testing.T) { } func TestLock_Destroy(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -252,6 +257,7 @@ func TestLock_Destroy(t *testing.T) { } func TestLock_Conflict(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -289,6 +295,7 @@ func TestLock_Conflict(t *testing.T) { } func TestLock_ReclaimLock(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() diff --git a/api/semaphore_test.go b/api/semaphore_test.go index cb5057df95..5e5e53588c 100644 --- a/api/semaphore_test.go +++ b/api/semaphore_test.go @@ -8,6 +8,7 @@ import ( ) func TestSemaphore_AcquireRelease(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -65,6 +66,7 @@ func TestSemaphore_AcquireRelease(t *testing.T) { } func TestSemaphore_ForceInvalidate(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -99,6 +101,7 @@ func TestSemaphore_ForceInvalidate(t *testing.T) { } func TestSemaphore_DeleteKey(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -132,6 +135,7 @@ func TestSemaphore_DeleteKey(t *testing.T) { } func TestSemaphore_Contend(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -184,6 +188,7 @@ func TestSemaphore_Contend(t *testing.T) { } func TestSemaphore_BadLimit(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -214,6 +219,7 @@ func TestSemaphore_BadLimit(t *testing.T) { } func TestSemaphore_Destroy(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -269,6 +275,7 @@ func TestSemaphore_Destroy(t *testing.T) { } func TestSemaphore_Conflict(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() diff --git a/api/session_test.go b/api/session_test.go index 194c45fb7f..c503c21a07 100644 --- a/api/session_test.go +++ b/api/session_test.go @@ -5,6 +5,7 @@ import ( ) func TestSession_CreateDestroy(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -34,6 +35,7 @@ func TestSession_CreateDestroy(t *testing.T) { } func TestSession_CreateRenewDestroy(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -84,6 +86,7 @@ func TestSession_CreateRenewDestroy(t *testing.T) { } func TestSession_Info(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -137,6 +140,7 @@ func TestSession_Info(t *testing.T) { } func TestSession_Node(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -171,6 +175,7 @@ func TestSession_Node(t *testing.T) { } func TestSession_List(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() diff --git a/api/status_test.go b/api/status_test.go index cb0cca6728..62dc1550ff 100644 --- a/api/status_test.go +++ b/api/status_test.go @@ -5,6 +5,7 @@ import ( ) func TestStatusLeader(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop() @@ -20,6 +21,7 @@ func TestStatusLeader(t *testing.T) { } func TestStatusPeers(t *testing.T) { + t.Parallel() c, s := makeClient(t) defer s.Stop()