diff --git a/client/allocrunner/groupservice_hook_test.go b/client/allocrunner/groupservice_hook_test.go index abec8a131..12a46358d 100644 --- a/client/allocrunner/groupservice_hook_test.go +++ b/client/allocrunner/groupservice_hook_test.go @@ -157,7 +157,7 @@ func TestGroupServiceHook_GroupServices(t *testing.T) { // TestGroupServiceHook_GroupServices_Nomad asserts group service hooks with // group services does not error when using the Nomad provider. func TestGroupServiceHook_GroupServices_Nomad(t *testing.T) { - t.Parallel() + ci.Parallel(t) // Create a mock alloc, and add a group service using provider Nomad. alloc := mock.Alloc() diff --git a/client/allocrunner/taskrunner/service_hook_test.go b/client/allocrunner/taskrunner/service_hook_test.go index 655a2e1bf..ae59fb649 100644 --- a/client/allocrunner/taskrunner/service_hook_test.go +++ b/client/allocrunner/taskrunner/service_hook_test.go @@ -156,7 +156,7 @@ func Test_serviceHook_multipleDeRegisterCall(t *testing.T) { // Test_serviceHook_Nomad performs a normal operation test of the serviceHook // when using task services which utilise the Nomad provider. func Test_serviceHook_Nomad(t *testing.T) { - t.Parallel() + ci.Parallel(t) // Create a mock alloc, and add a task service using provider Nomad. alloc := mock.Alloc() diff --git a/command/agent/alloc_endpoint_test.go b/command/agent/alloc_endpoint_test.go index 01aebdd55..cfae04dd9 100644 --- a/command/agent/alloc_endpoint_test.go +++ b/command/agent/alloc_endpoint_test.go @@ -435,7 +435,7 @@ func TestHTTP_AllocStop(t *testing.T) { } func TestHTTP_allocServiceRegistrations(t *testing.T) { - t.Parallel() + ci.Parallel(t) testCases := []struct { testFn func(srv *TestAgent) diff --git a/command/agent/eval_endpoint_test.go b/command/agent/eval_endpoint_test.go index df651d462..2c9665d91 100644 --- a/command/agent/eval_endpoint_test.go +++ b/command/agent/eval_endpoint_test.go @@ -202,7 +202,7 @@ func TestHTTP_EvalQuery(t *testing.T) { } func TestHTTP_EvalQueryWithRelated(t *testing.T) { - t.Parallel() + ci.Parallel(t) httpTest(t, nil, func(s *TestAgent) { // Directly manipulate the state state := s.Agent.server.State() diff --git a/command/agent/job_endpoint_test.go b/command/agent/job_endpoint_test.go index 6cee319db..3dd9197ec 100644 --- a/command/agent/job_endpoint_test.go +++ b/command/agent/job_endpoint_test.go @@ -2250,7 +2250,7 @@ func TestJobs_NamespaceForJob(t *testing.T) { } func TestHTTPServer_jobServiceRegistrations(t *testing.T) { - t.Parallel() + ci.Parallel(t) testCases := []struct { testFn func(srv *TestAgent) diff --git a/command/agent/service_registration_endpoint_test.go b/command/agent/service_registration_endpoint_test.go index e02edc060..d6e695437 100644 --- a/command/agent/service_registration_endpoint_test.go +++ b/command/agent/service_registration_endpoint_test.go @@ -7,13 +7,14 @@ import ( "testing" "github.com/hashicorp/go-memdb" + "github.com/hashicorp/nomad/ci" "github.com/hashicorp/nomad/nomad/mock" "github.com/hashicorp/nomad/nomad/structs" "github.com/stretchr/testify/require" ) func TestHTTPServer_ServiceRegistrationListRequest(t *testing.T) { - t.Parallel() + ci.Parallel(t) testCases := []struct { testFn func(srv *TestAgent) @@ -149,7 +150,7 @@ func TestHTTPServer_ServiceRegistrationListRequest(t *testing.T) { } func TestHTTPServer_ServiceRegistrationRequest(t *testing.T) { - t.Parallel() + ci.Parallel(t) testCases := []struct { testFn func(srv *TestAgent) diff --git a/command/service_delete_test.go b/command/service_delete_test.go index fc7768fe0..6e17d5f14 100644 --- a/command/service_delete_test.go +++ b/command/service_delete_test.go @@ -5,13 +5,14 @@ import ( "testing" "github.com/hashicorp/nomad/api" + "github.com/hashicorp/nomad/ci" "github.com/hashicorp/nomad/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/require" ) func TestServiceDeleteCommand_Run(t *testing.T) { - t.Parallel() + ci.Parallel(t) srv, client, url := testServer(t, true, nil) defer srv.Shutdown() diff --git a/command/service_info_test.go b/command/service_info_test.go index 70fdb6df0..08990deed 100644 --- a/command/service_info_test.go +++ b/command/service_info_test.go @@ -6,6 +6,7 @@ import ( "time" "github.com/hashicorp/nomad/api" + "github.com/hashicorp/nomad/ci" "github.com/hashicorp/nomad/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" @@ -13,7 +14,7 @@ import ( ) func TestServiceInfoCommand_Run(t *testing.T) { - t.Parallel() + ci.Parallel(t) srv, client, url := testServer(t, true, nil) defer srv.Shutdown() diff --git a/command/service_list_test.go b/command/service_list_test.go index 8295963f9..b26479e5e 100644 --- a/command/service_list_test.go +++ b/command/service_list_test.go @@ -6,6 +6,7 @@ import ( "time" "github.com/hashicorp/nomad/api" + "github.com/hashicorp/nomad/ci" "github.com/hashicorp/nomad/testutil" "github.com/mitchellh/cli" "github.com/stretchr/testify/assert" @@ -13,7 +14,7 @@ import ( ) func TestServiceListCommand_Run(t *testing.T) { - t.Parallel() + ci.Parallel(t) srv, client, url := testServer(t, true, nil) defer srv.Shutdown() diff --git a/nomad/alloc_endpoint_test.go b/nomad/alloc_endpoint_test.go index 7a2103b00..b15fae6e3 100644 --- a/nomad/alloc_endpoint_test.go +++ b/nomad/alloc_endpoint_test.go @@ -1362,7 +1362,7 @@ func TestAllocEndpoint_List_AllNamespaces_ACL_OSS(t *testing.T) { } func TestAlloc_GetServiceRegistrations(t *testing.T) { - t.Parallel() + ci.Parallel(t) // This function is a helper function to set up an allocation and service // which can be queried. diff --git a/nomad/fsm_test.go b/nomad/fsm_test.go index ecf1f4696..cab4a6366 100644 --- a/nomad/fsm_test.go +++ b/nomad/fsm_test.go @@ -3260,7 +3260,7 @@ func TestFSM_SnapshotRestore_Namespaces(t *testing.T) { } func TestFSM_UpsertServiceRegistrations(t *testing.T) { - t.Parallel() + ci.Parallel(t) fsm := testFSM(t) // Generate our test service registrations. @@ -3284,7 +3284,7 @@ func TestFSM_UpsertServiceRegistrations(t *testing.T) { } func TestFSM_DeleteServiceRegistrationsByID(t *testing.T) { - t.Parallel() + ci.Parallel(t) fsm := testFSM(t) // Generate our test service registrations. @@ -3312,7 +3312,7 @@ func TestFSM_DeleteServiceRegistrationsByID(t *testing.T) { } func TestFSM_DeleteServiceRegistrationsByNodeID(t *testing.T) { - t.Parallel() + ci.Parallel(t) fsm := testFSM(t) // Generate our test service registrations. Set them both to have the same diff --git a/nomad/job_endpoint_hooks_test.go b/nomad/job_endpoint_hooks_test.go index 8e146972a..f93637287 100644 --- a/nomad/job_endpoint_hooks_test.go +++ b/nomad/job_endpoint_hooks_test.go @@ -3,12 +3,13 @@ package nomad import ( "testing" + "github.com/hashicorp/nomad/ci" "github.com/hashicorp/nomad/nomad/structs" "github.com/stretchr/testify/require" ) func Test_jobImpliedConstraints_Mutate(t *testing.T) { - t.Parallel() + ci.Parallel(t) testCases := []struct { inputJob *structs.Job diff --git a/nomad/job_endpoint_test.go b/nomad/job_endpoint_test.go index ca49b7aeb..6802e2bf6 100644 --- a/nomad/job_endpoint_test.go +++ b/nomad/job_endpoint_test.go @@ -7920,7 +7920,7 @@ func TestJobEndpoint_GetScaleStatus_ACL(t *testing.T) { } func TestJob_GetServiceRegistrations(t *testing.T) { - t.Parallel() + ci.Parallel(t) // This function is a helper function to set up job and service which can // be queried. diff --git a/nomad/node_endpoint_test.go b/nomad/node_endpoint_test.go index 0ce68721d..222de1ae2 100644 --- a/nomad/node_endpoint_test.go +++ b/nomad/node_endpoint_test.go @@ -871,7 +871,7 @@ func TestClientEndpoint_UpdateStatus_HeartbeatOnly_Advertise(t *testing.T) { } func TestNode_UpdateStatus_ServiceRegistrations(t *testing.T) { - t.Parallel() + ci.Parallel(t) testServer, serverCleanup := TestServer(t, nil) defer serverCleanup() diff --git a/nomad/service_registration_endpoint_test.go b/nomad/service_registration_endpoint_test.go index cff347311..49831eefd 100644 --- a/nomad/service_registration_endpoint_test.go +++ b/nomad/service_registration_endpoint_test.go @@ -6,6 +6,7 @@ import ( "github.com/hashicorp/go-memdb" msgpackrpc "github.com/hashicorp/net-rpc-msgpackrpc" "github.com/hashicorp/nomad/acl" + "github.com/hashicorp/nomad/ci" "github.com/hashicorp/nomad/nomad/mock" "github.com/hashicorp/nomad/nomad/structs" "github.com/hashicorp/nomad/testutil" @@ -13,7 +14,7 @@ import ( ) func TestServiceRegistration_Upsert(t *testing.T) { - t.Parallel() + ci.Parallel(t) testCases := []struct { serverFn func(t *testing.T) (*Server, *structs.ACLToken, func()) @@ -198,7 +199,7 @@ func TestServiceRegistration_Upsert(t *testing.T) { } func TestServiceRegistration_DeleteByID(t *testing.T) { - t.Parallel() + ci.Parallel(t) testCases := []struct { serverFn func(t *testing.T) (*Server, *structs.ACLToken, func()) @@ -401,7 +402,7 @@ func TestServiceRegistration_DeleteByID(t *testing.T) { } func TestServiceRegistration_List(t *testing.T) { - t.Parallel() + ci.Parallel(t) testCases := []struct { serverFn func(t *testing.T) (*Server, *structs.ACLToken, func()) @@ -811,7 +812,7 @@ func TestServiceRegistration_List(t *testing.T) { } func TestServiceRegistration_GetService(t *testing.T) { - t.Parallel() + ci.Parallel(t) testCases := []struct { serverFn func(t *testing.T) (*Server, *structs.ACLToken, func()) diff --git a/nomad/state/events_test.go b/nomad/state/events_test.go index b3d9d4681..7e25a6194 100644 --- a/nomad/state/events_test.go +++ b/nomad/state/events_test.go @@ -956,7 +956,7 @@ func TestNodeDrainEventFromChanges(t *testing.T) { } func Test_eventsFromChanges_ServiceRegistration(t *testing.T) { - t.Parallel() + ci.Parallel(t) testState := TestStateStoreCfg(t, TestStateStorePublisher(t)) defer testState.StopEventBroker() diff --git a/nomad/state/state_store_restore_test.go b/nomad/state/state_store_restore_test.go index ea92c29ee..8bc0fe2e6 100644 --- a/nomad/state/state_store_restore_test.go +++ b/nomad/state/state_store_restore_test.go @@ -544,7 +544,7 @@ func TestStateStore_RestoreSchedulerConfig(t *testing.T) { } func TestStateStore_ServiceRegistrationRestore(t *testing.T) { - t.Parallel() + ci.Parallel(t) testState := testStateStore(t) // Set up our test registrations and index. diff --git a/nomad/state/state_store_service_regisration_test.go b/nomad/state/state_store_service_regisration_test.go index 84ca6c93d..25cc28875 100644 --- a/nomad/state/state_store_service_regisration_test.go +++ b/nomad/state/state_store_service_regisration_test.go @@ -5,13 +5,14 @@ import ( "testing" "github.com/hashicorp/go-memdb" + "github.com/hashicorp/nomad/ci" "github.com/hashicorp/nomad/nomad/mock" "github.com/hashicorp/nomad/nomad/structs" "github.com/stretchr/testify/require" ) func TestStateStore_UpsertServiceRegistrations(t *testing.T) { - t.Parallel() + ci.Parallel(t) testState := testStateStore(t) // SubTest Marker: This ensures new service registrations are inserted as @@ -143,7 +144,7 @@ func TestStateStore_UpsertServiceRegistrations(t *testing.T) { } func TestStateStore_DeleteServiceRegistrationByID(t *testing.T) { - t.Parallel() + ci.Parallel(t) testState := testStateStore(t) // Generate some test services that we will use and modify throughout. @@ -216,7 +217,7 @@ func TestStateStore_DeleteServiceRegistrationByID(t *testing.T) { } func TestStateStore_DeleteServiceRegistrationByNodeID(t *testing.T) { - t.Parallel() + ci.Parallel(t) testState := testStateStore(t) // Generate some test services that we will use and modify throughout. @@ -312,7 +313,7 @@ func TestStateStore_DeleteServiceRegistrationByNodeID(t *testing.T) { } func TestStateStore_GetServiceRegistrations(t *testing.T) { - t.Parallel() + ci.Parallel(t) testState := testStateStore(t) // Generate some test services and upsert them. @@ -347,7 +348,7 @@ func TestStateStore_GetServiceRegistrations(t *testing.T) { } func TestStateStore_GetServiceRegistrationsByNamespace(t *testing.T) { - t.Parallel() + ci.Parallel(t) testState := testStateStore(t) // Generate some test services and upsert them. @@ -400,7 +401,7 @@ func TestStateStore_GetServiceRegistrationsByNamespace(t *testing.T) { } func TestStateStore_GetServiceRegistrationByName(t *testing.T) { - t.Parallel() + ci.Parallel(t) testState := testStateStore(t) // Generate some test services and upsert them. @@ -473,7 +474,7 @@ func TestStateStore_GetServiceRegistrationByName(t *testing.T) { } func TestStateStore_GetServiceRegistrationByID(t *testing.T) { - t.Parallel() + ci.Parallel(t) testState := testStateStore(t) // Generate some test services and upsert them. @@ -499,7 +500,7 @@ func TestStateStore_GetServiceRegistrationByID(t *testing.T) { } func TestStateStore_GetServiceRegistrationsByAllocID(t *testing.T) { - t.Parallel() + ci.Parallel(t) testState := testStateStore(t) // Generate some test services and upsert them. @@ -543,7 +544,7 @@ func TestStateStore_GetServiceRegistrationsByAllocID(t *testing.T) { } func TestStateStore_GetServiceRegistrationsByJobID(t *testing.T) { - t.Parallel() + ci.Parallel(t) testState := testStateStore(t) // Generate some test services and upsert them. @@ -593,7 +594,7 @@ func TestStateStore_GetServiceRegistrationsByJobID(t *testing.T) { } func TestStateStore_GetServiceRegistrationsByNodeID(t *testing.T) { - t.Parallel() + ci.Parallel(t) testState := testStateStore(t) // Generate some test services and upsert them. diff --git a/nomad/state/state_store_test.go b/nomad/state/state_store_test.go index 0859b6e54..25df0e625 100644 --- a/nomad/state/state_store_test.go +++ b/nomad/state/state_store_test.go @@ -4599,7 +4599,7 @@ func TestStateStore_EvalsByIDPrefix_Namespaces(t *testing.T) { } func TestStateStore_EvalsRelatedToID(t *testing.T) { - t.Parallel() + ci.Parallel(t) state := testStateStore(t) diff --git a/nomad/structs/services_test.go b/nomad/structs/services_test.go index 510884253..915a5a969 100644 --- a/nomad/structs/services_test.go +++ b/nomad/structs/services_test.go @@ -2,10 +2,10 @@ package structs import ( "errors" - "github.com/hashicorp/go-multierror" "testing" "time" + "github.com/hashicorp/go-multierror" "github.com/hashicorp/nomad/ci" "github.com/hashicorp/nomad/helper" "github.com/stretchr/testify/require" @@ -1479,7 +1479,7 @@ func TestConsulMeshGateway_Validate(t *testing.T) { } func TestService_validateNomadService(t *testing.T) { - t.Parallel() + ci.Parallel(t) testCases := []struct { inputService *Service