diff --git a/internal/mode/provisioner/provisioner_suite_test.go b/internal/mode/provisioner/provisioner_suite_test.go index 6cfdb4144c..1435a2230e 100644 --- a/internal/mode/provisioner/provisioner_suite_test.go +++ b/internal/mode/provisioner/provisioner_suite_test.go @@ -8,6 +8,7 @@ import ( ) func TestProvisioner(t *testing.T) { + t.Parallel() RegisterFailHandler(Fail) RunSpecs(t, "Provisioner Suite") } diff --git a/internal/mode/static/config_updater_test.go b/internal/mode/static/config_updater_test.go index ee44971950..5a40f9a924 100644 --- a/internal/mode/static/config_updater_test.go +++ b/internal/mode/static/config_updater_test.go @@ -103,6 +103,7 @@ func TestUpdateControlPlane(t *testing.T) { } func TestValidateLogLevel(t *testing.T) { + t.Parallel() validLevels := []ngfAPI.ControllerLogLevel{ ngfAPI.ControllerLogLevelError, ngfAPI.ControllerLogLevelInfo, @@ -125,6 +126,7 @@ func TestValidateLogLevel(t *testing.T) { for _, level := range invalidLevels { t.Run(fmt.Sprintf("invalid level %q", level), func(t *testing.T) { + t.Parallel() g := NewWithT(t) g.Expect(validateLogLevel(level)).ToNot(Succeed()) diff --git a/internal/mode/static/health_test.go b/internal/mode/static/health_test.go index 352cc50b3c..5bfd7aab73 100644 --- a/internal/mode/static/health_test.go +++ b/internal/mode/static/health_test.go @@ -7,6 +7,7 @@ import ( ) func TestReadyCheck(t *testing.T) { + t.Parallel() g := NewWithT(t) nginxChecker := newNginxConfiguredOnStartChecker() g.Expect(nginxChecker.readyCheck(nil)).ToNot(Succeed()) diff --git a/internal/mode/static/log_level_setters_test.go b/internal/mode/static/log_level_setters_test.go index 214b9a15bc..df2d51f447 100644 --- a/internal/mode/static/log_level_setters_test.go +++ b/internal/mode/static/log_level_setters_test.go @@ -11,6 +11,7 @@ import ( ) func TestMultiLogLevelSetter_SetLevel(t *testing.T) { + t.Parallel() g := NewWithT(t) logr1 := &staticfakes.FakeLogLevelSetter{} @@ -41,6 +42,7 @@ func TestMultiLogLevelSetter_SetLevel(t *testing.T) { } func TestZapLogLevelSetter_SetLevel(t *testing.T) { + t.Parallel() g := NewWithT(t) zapSetter := newZapLogLevelSetter(zap.NewAtomicLevel()) @@ -58,6 +60,7 @@ func TestZapLogLevelSetter_SetLevel(t *testing.T) { } func TestPromLogLevelSetter_SetLevel(t *testing.T) { + t.Parallel() g := NewWithT(t) logger, err := newLeveledPrometheusLogger() diff --git a/internal/mode/static/manager_test.go b/internal/mode/static/manager_test.go index 041f5062b6..6d44de67e6 100644 --- a/internal/mode/static/manager_test.go +++ b/internal/mode/static/manager_test.go @@ -22,6 +22,7 @@ import ( ) func TestPrepareFirstEventBatchPreparerArgs(t *testing.T) { + t.Parallel() const gcName = "nginx" partialObjectMetadataList := &metav1.PartialObjectMetadataList{} @@ -117,6 +118,7 @@ func TestPrepareFirstEventBatchPreparerArgs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) objects, objectLists := prepareFirstEventBatchPreparerArgs(gcName, test.gwNsName, test.experimentalEnabled) @@ -128,6 +130,7 @@ func TestPrepareFirstEventBatchPreparerArgs(t *testing.T) { } func TestGetMetricsOptions(t *testing.T) { + t.Parallel() tests := []struct { name string expectedOptions metricsserver.Options @@ -166,6 +169,7 @@ func TestGetMetricsOptions(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) metricsServerOptions := getMetricsOptions(test.metricsConfig) diff --git a/internal/mode/static/nginx/file/file_suite_test.go b/internal/mode/static/nginx/file/file_suite_test.go index 46afb4ea54..9017ae221f 100644 --- a/internal/mode/static/nginx/file/file_suite_test.go +++ b/internal/mode/static/nginx/file/file_suite_test.go @@ -8,6 +8,7 @@ import ( ) func TestFile(t *testing.T) { + t.Parallel() RegisterFailHandler(Fail) RunSpecs(t, "File Suite") } diff --git a/internal/mode/static/nginx/file/folders_test.go b/internal/mode/static/nginx/file/folders_test.go index 9e1e8f518b..8a63b12106 100644 --- a/internal/mode/static/nginx/file/folders_test.go +++ b/internal/mode/static/nginx/file/folders_test.go @@ -21,6 +21,7 @@ func writeFile(t *testing.T, name string, data []byte) { } func TestClearFoldersRemoves(t *testing.T) { + t.Parallel() g := NewWithT(t) tempDir := t.TempDir() @@ -41,6 +42,7 @@ func TestClearFoldersRemoves(t *testing.T) { } func TestClearFoldersFails(t *testing.T) { + t.Parallel() files := []string{"file"} testErr := errors.New("test error") @@ -78,6 +80,7 @@ func TestClearFoldersFails(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) removedFiles, err := file.ClearFolders(test.fileMgr, files) diff --git a/internal/mode/static/nginx/runtime/manager_test.go b/internal/mode/static/nginx/runtime/manager_test.go index 7b3c30af15..15eb498a7f 100644 --- a/internal/mode/static/nginx/runtime/manager_test.go +++ b/internal/mode/static/nginx/runtime/manager_test.go @@ -223,6 +223,7 @@ var _ = Describe("NGINX Runtime Manager", func() { }) func TestFindMainProcess(t *testing.T) { + t.Parallel() readFileFuncGen := func(content []byte) runtime.ReadFileFunc { return func(name string) ([]byte, error) { if name != runtime.PidFile { @@ -311,6 +312,7 @@ func TestFindMainProcess(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) p := runtime.NewProcessHandlerImpl( test.readFile, diff --git a/internal/mode/static/nginx/runtime/runtime_suite_test.go b/internal/mode/static/nginx/runtime/runtime_suite_test.go index 7a31e6ebf4..8916c4bf14 100644 --- a/internal/mode/static/nginx/runtime/runtime_suite_test.go +++ b/internal/mode/static/nginx/runtime/runtime_suite_test.go @@ -8,6 +8,7 @@ import ( ) func TestRuntime(t *testing.T) { + t.Parallel() RegisterFailHandler(Fail) RunSpecs(t, "Runtime Suite") } diff --git a/internal/mode/static/nginx/runtime/verify_test.go b/internal/mode/static/nginx/runtime/verify_test.go index 34982f48be..d20844a410 100644 --- a/internal/mode/static/nginx/runtime/verify_test.go +++ b/internal/mode/static/nginx/runtime/verify_test.go @@ -30,6 +30,7 @@ func getTestHTTPClient() *http.Client { } func TestVerifyClient(t *testing.T) { + t.Parallel() c := VerifyClient{ client: getTestHTTPClient(), timeout: 25 * time.Millisecond, @@ -87,6 +88,7 @@ func TestVerifyClient(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) err := c.WaitForCorrectVersion(test.ctx, test.expectedVersion, "/childfile", []byte("1 2 3"), test.readFile) @@ -101,6 +103,7 @@ func TestVerifyClient(t *testing.T) { } func TestEnsureNewNginxWorkers(t *testing.T) { + t.Parallel() previousContents := []byte("1 2 3") newContents := []byte("4 5 6") @@ -163,6 +166,7 @@ func TestEnsureNewNginxWorkers(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) err := ensureNewNginxWorkers( diff --git a/internal/mode/static/sort/sort_test.go b/internal/mode/static/sort/sort_test.go index d1b63e830d..d608fa8f40 100644 --- a/internal/mode/static/sort/sort_test.go +++ b/internal/mode/static/sort/sort_test.go @@ -11,6 +11,7 @@ import ( ) func TestLessObjectMeta(t *testing.T) { + t.Parallel() before := metav1.Now() later := metav1.NewTime(before.Add(1 * time.Second)) @@ -80,6 +81,7 @@ func TestLessObjectMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) result := LessObjectMeta(test.meta1, test.meta2) @@ -92,6 +94,7 @@ func TestLessObjectMeta(t *testing.T) { } func TestLessClientObject(t *testing.T) { + t.Parallel() before := metav1.Now() later := metav1.NewTime(before.Add(1 * time.Second)) @@ -177,6 +180,7 @@ func TestLessClientObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) result := LessClientObject(test.obj1, test.obj2) diff --git a/internal/mode/static/static_suite_test.go b/internal/mode/static/static_suite_test.go index 95fafaeec7..0d47b11d5b 100644 --- a/internal/mode/static/static_suite_test.go +++ b/internal/mode/static/static_suite_test.go @@ -8,6 +8,7 @@ import ( ) func TestStatic(t *testing.T) { + t.Parallel() RegisterFailHandler(Fail) RunSpecs(t, "Static Suite") } diff --git a/internal/mode/static/status/prepare_requests_test.go b/internal/mode/static/status/prepare_requests_test.go index 3e98e777c1..292210efe1 100644 --- a/internal/mode/static/status/prepare_requests_test.go +++ b/internal/mode/static/status/prepare_requests_test.go @@ -212,6 +212,7 @@ var ( ) func TestBuildHTTPRouteStatuses(t *testing.T) { + t.Parallel() hrValid := &v1.HTTPRoute{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", @@ -291,6 +292,7 @@ func TestBuildHTTPRouteStatuses(t *testing.T) { } func TestBuildGRPCRouteStatuses(t *testing.T) { + t.Parallel() grValid := &v1.GRPCRoute{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", @@ -369,6 +371,7 @@ func TestBuildGRPCRouteStatuses(t *testing.T) { } func TestBuildTLSRouteStatuses(t *testing.T) { + t.Parallel() trValid := &v1alpha2.TLSRoute{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", @@ -445,6 +448,7 @@ func TestBuildTLSRouteStatuses(t *testing.T) { } func TestBuildRouteStatusesNginxErr(t *testing.T) { + t.Parallel() const gatewayCtlrName = "controller" hr1 := &v1.HTTPRoute{ @@ -546,6 +550,7 @@ func TestBuildRouteStatusesNginxErr(t *testing.T) { } func TestBuildGatewayClassStatuses(t *testing.T) { + t.Parallel() transitionTime := helpers.PrepareTimeForFakeClient(metav1.Now()) tests := []struct { @@ -638,6 +643,7 @@ func TestBuildGatewayClassStatuses(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) k8sClient := createK8sClientFor(&v1.GatewayClass{}) @@ -676,6 +682,7 @@ func TestBuildGatewayClassStatuses(t *testing.T) { } func TestBuildGatewayStatuses(t *testing.T) { + t.Parallel() createGateway := func() *v1.Gateway { return &v1.Gateway{ ObjectMeta: metav1.ObjectMeta{ @@ -1131,6 +1138,7 @@ func TestBuildGatewayStatuses(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) k8sClient := createK8sClientFor(&v1.Gateway{}) @@ -1176,6 +1184,7 @@ func TestBuildGatewayStatuses(t *testing.T) { } func TestBuildBackendTLSPolicyStatuses(t *testing.T) { + t.Parallel() const gatewayCtlrName = "controller" transitionTime := helpers.PrepareTimeForFakeClient(metav1.Now()) @@ -1357,6 +1366,7 @@ func TestBuildBackendTLSPolicyStatuses(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) k8sClient := createK8sClientFor(&v1alpha3.BackendTLSPolicy{}) @@ -1386,6 +1396,7 @@ func TestBuildBackendTLSPolicyStatuses(t *testing.T) { } func TestBuildNginxGatewayStatus(t *testing.T) { + t.Parallel() transitionTime := helpers.PrepareTimeForFakeClient(metav1.Now()) tests := []struct { @@ -1449,6 +1460,7 @@ func TestBuildNginxGatewayStatus(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) k8sClient := createK8sClientFor(&ngfAPI.NginxGateway{}) @@ -1479,6 +1491,7 @@ func TestBuildNginxGatewayStatus(t *testing.T) { } func TestBuildNGFPolicyStatuses(t *testing.T) { + t.Parallel() const gatewayCtlrName = "controller" transitionTime := helpers.PrepareTimeForFakeClient(metav1.Now()) @@ -1741,6 +1754,7 @@ func TestBuildNGFPolicyStatuses(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) k8sClient := createK8sClientFor(&ngfAPI.ClientSettingsPolicy{}) diff --git a/internal/mode/static/status/status_setters_test.go b/internal/mode/static/status/status_setters_test.go index d91c610ff7..35b2d898bd 100644 --- a/internal/mode/static/status/status_setters_test.go +++ b/internal/mode/static/status/status_setters_test.go @@ -16,6 +16,7 @@ import ( ) func TestNewNginxGatewayStatusSetter(t *testing.T) { + t.Parallel() tests := []struct { name string status, newStatus ngfAPI.NginxGatewayStatus @@ -53,6 +54,7 @@ func TestNewNginxGatewayStatusSetter(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) setter := newNginxGatewayStatusSetter(test.newStatus) @@ -67,6 +69,7 @@ func TestNewNginxGatewayStatusSetter(t *testing.T) { } func TestNewGatewayStatusSetter(t *testing.T) { + t.Parallel() expAddress := gatewayv1.GatewayStatusAddress{ Type: helpers.GetPointer(gatewayv1.IPAddressType), Value: "10.0.0.0", @@ -114,6 +117,7 @@ func TestNewGatewayStatusSetter(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) setter := newGatewayStatusSetter(test.newStatus) @@ -128,6 +132,7 @@ func TestNewGatewayStatusSetter(t *testing.T) { } func TestNewHTTPRouteStatusSetter(t *testing.T) { + t.Parallel() const ( controllerName = "controller" otherControllerName = "different" @@ -289,6 +294,7 @@ func TestNewHTTPRouteStatusSetter(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) setter := newHTTPRouteStatusSetter(test.newStatus, controllerName) @@ -303,6 +309,7 @@ func TestNewHTTPRouteStatusSetter(t *testing.T) { } func TestNewGRPCRouteStatusSetter(t *testing.T) { + t.Parallel() const ( controllerName = "controller" otherControllerName = "different" @@ -464,6 +471,7 @@ func TestNewGRPCRouteStatusSetter(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) setter := newGRPCRouteStatusSetter(test.newStatus, controllerName) @@ -478,6 +486,7 @@ func TestNewGRPCRouteStatusSetter(t *testing.T) { } func TestNewTLSRouteStatusSetter(t *testing.T) { + t.Parallel() const ( controllerName = "controller" otherControllerName = "different" @@ -639,6 +648,7 @@ func TestNewTLSRouteStatusSetter(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) setter := newTLSRouteStatusSetter(test.newStatus, controllerName) @@ -653,6 +663,7 @@ func TestNewTLSRouteStatusSetter(t *testing.T) { } func TestNewGatewayClassStatusSetter(t *testing.T) { + t.Parallel() tests := []struct { name string status, newStatus gatewayv1.GatewayClassStatus @@ -689,6 +700,7 @@ func TestNewGatewayClassStatusSetter(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) setter := newGatewayClassStatusSetter(test.newStatus) @@ -703,6 +715,7 @@ func TestNewGatewayClassStatusSetter(t *testing.T) { } func TestNewBackendTLSPolicyStatusSetter(t *testing.T) { + t.Parallel() const ( controllerName = "controller" otherControllerName = "other-controller" @@ -829,6 +842,7 @@ func TestNewBackendTLSPolicyStatusSetter(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) setter := newBackendTLSPolicyStatusSetter(test.newStatus, controllerName) @@ -843,6 +857,7 @@ func TestNewBackendTLSPolicyStatusSetter(t *testing.T) { } func TestNewNGFPolicyStatusSetter(t *testing.T) { + t.Parallel() const ( controllerName = "controller" otherControllerName = "other-controller" @@ -969,6 +984,7 @@ func TestNewNGFPolicyStatusSetter(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) setter := newNGFPolicyStatusSetter(test.newStatus, controllerName) @@ -990,6 +1006,7 @@ func TestNewNGFPolicyStatusSetter(t *testing.T) { } func TestGWStatusEqual(t *testing.T) { + t.Parallel() getDefaultStatus := func() gatewayv1.GatewayStatus { return gatewayv1.GatewayStatus{ Addresses: []gatewayv1.GatewayStatusAddress{ @@ -1180,6 +1197,7 @@ func TestGWStatusEqual(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) equal := gwStatusEqual(test.prevStatus, test.curStatus) @@ -1189,6 +1207,7 @@ func TestGWStatusEqual(t *testing.T) { } func TestHRStatusEqual(t *testing.T) { + t.Parallel() testConds := []metav1.Condition{ { Type: "type", /* conditions are covered by another test*/ @@ -1317,6 +1336,7 @@ func TestHRStatusEqual(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) equal := routeStatusEqual("ours", test.prevStatus.Parents, test.curStatus.Parents) g.Expect(equal).To(Equal(test.expEqual)) @@ -1325,6 +1345,7 @@ func TestHRStatusEqual(t *testing.T) { } func TestRouteParentStatusEqual(t *testing.T) { + t.Parallel() getDefaultStatus := func() gatewayv1.RouteParentStatus { return gatewayv1.RouteParentStatus{ ParentRef: gatewayv1.ParentReference{ @@ -1408,6 +1429,7 @@ func TestRouteParentStatusEqual(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) equal := routeParentStatusEqual(test.p1, test.p2) g.Expect(equal).To(Equal(test.expEqual)) @@ -1416,6 +1438,7 @@ func TestRouteParentStatusEqual(t *testing.T) { } func TestPolicyStatusEqual(t *testing.T) { + t.Parallel() getPolicyStatus := func() v1alpha2.PolicyStatus { return v1alpha2.PolicyStatus{ Ancestors: []v1alpha2.PolicyAncestorStatus{ @@ -1557,6 +1580,7 @@ func TestPolicyStatusEqual(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) equal := policyStatusEqual(test.controllerName, test.previous, test.current) g.Expect(equal).To(Equal(test.expEqual)) diff --git a/internal/mode/static/telemetry/data_test.go b/internal/mode/static/telemetry/data_test.go index 62bb54f6c8..893203fd9e 100644 --- a/internal/mode/static/telemetry/data_test.go +++ b/internal/mode/static/telemetry/data_test.go @@ -9,6 +9,7 @@ import ( ) func TestDataAttributes(t *testing.T) { + t.Parallel() data := Data{ ImageSource: "local", Data: tel.Data{ @@ -77,6 +78,7 @@ func TestDataAttributes(t *testing.T) { } func TestDataAttributesWithEmptyData(t *testing.T) { + t.Parallel() data := Data{} expected := []attribute.KeyValue{ diff --git a/internal/mode/static/telemetry/exporter_test.go b/internal/mode/static/telemetry/exporter_test.go index 6a86a01685..d44a7d2e24 100644 --- a/internal/mode/static/telemetry/exporter_test.go +++ b/internal/mode/static/telemetry/exporter_test.go @@ -10,6 +10,7 @@ import ( ) func TestLoggingExporter(t *testing.T) { + t.Parallel() g := NewWithT(t) var buffer bytes.Buffer diff --git a/internal/mode/static/telemetry/job_worker_test.go b/internal/mode/static/telemetry/job_worker_test.go index 88cc7fbc4c..1425fc3970 100644 --- a/internal/mode/static/telemetry/job_worker_test.go +++ b/internal/mode/static/telemetry/job_worker_test.go @@ -15,6 +15,7 @@ import ( ) func TestCreateTelemetryJobWorker_Succeeds(t *testing.T) { + t.Parallel() g := NewWithT(t) exporter := &telemetryfakes.FakeExporter{} @@ -39,6 +40,7 @@ func TestCreateTelemetryJobWorker_Succeeds(t *testing.T) { } func TestCreateTelemetryJobWorker_CollectFails(t *testing.T) { + t.Parallel() g := NewWithT(t) exporter := &telemetryfakes.FakeExporter{} diff --git a/internal/mode/static/telemetry/platform_test.go b/internal/mode/static/telemetry/platform_test.go index 0c2939d820..aac138e44e 100644 --- a/internal/mode/static/telemetry/platform_test.go +++ b/internal/mode/static/telemetry/platform_test.go @@ -9,6 +9,7 @@ import ( ) func TestGetPlatform(t *testing.T) { + t.Parallel() tests := []struct { node *v1.Node namespaces *v1.NamespaceList @@ -128,6 +129,7 @@ func TestGetPlatform(t *testing.T) { } for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) platform := getPlatform(*test.node, *test.namespaces) diff --git a/internal/mode/static/telemetry/telemetry_suite_test.go b/internal/mode/static/telemetry/telemetry_suite_test.go index 2eae64e153..2f5a50adb4 100644 --- a/internal/mode/static/telemetry/telemetry_suite_test.go +++ b/internal/mode/static/telemetry/telemetry_suite_test.go @@ -8,6 +8,7 @@ import ( ) func TestTelemetry(t *testing.T) { + t.Parallel() RegisterFailHandler(Fail) RunSpecs(t, "Telemetry Suite") } diff --git a/internal/mode/static/usage/job_worker_test.go b/internal/mode/static/usage/job_worker_test.go index c94bf15698..034a2dade2 100644 --- a/internal/mode/static/usage/job_worker_test.go +++ b/internal/mode/static/usage/job_worker_test.go @@ -22,6 +22,7 @@ import ( ) func TestCreateUsageJobWorker(t *testing.T) { + t.Parallel() replicas := int32(1) ngfReplicaSet := &appsv1.ReplicaSet{ ObjectMeta: metav1.ObjectMeta{ @@ -139,6 +140,7 @@ func TestCreateUsageJobWorker(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) k8sClientReader := &eventsfakes.FakeReader{} @@ -178,6 +180,7 @@ func TestCreateUsageJobWorker(t *testing.T) { } func TestGetTotalNGFPodCount(t *testing.T) { + t.Parallel() g := NewWithT(t) rs1Replicas := int32(1) @@ -241,6 +244,7 @@ func TestGetTotalNGFPodCount(t *testing.T) { } func TestCollectNodeCount(t *testing.T) { + t.Parallel() g := NewWithT(t) node1 := &v1.Node{ diff --git a/internal/mode/static/usage/reporter_test.go b/internal/mode/static/usage/reporter_test.go index b57a5b3613..60db79f313 100644 --- a/internal/mode/static/usage/reporter_test.go +++ b/internal/mode/static/usage/reporter_test.go @@ -13,6 +13,7 @@ import ( ) func TestReport(t *testing.T) { + t.Parallel() g := NewWithT(t) data := ClusterDetails{ @@ -68,6 +69,7 @@ func TestReport(t *testing.T) { } func TestReport_NoCredentials(t *testing.T) { + t.Parallel() g := NewWithT(t) insecureSkipVerify := false reporter, err := NewNIMReporter(NewUsageSecret(), "", insecureSkipVerify) @@ -79,6 +81,7 @@ func TestReport_NoCredentials(t *testing.T) { } func TestReport_ServerError(t *testing.T) { + t.Parallel() g := NewWithT(t) server := httptest.NewServer( diff --git a/internal/mode/static/usage/secret_test.go b/internal/mode/static/usage/secret_test.go index 0320c72c16..82a5abd886 100644 --- a/internal/mode/static/usage/secret_test.go +++ b/internal/mode/static/usage/secret_test.go @@ -9,6 +9,7 @@ import ( ) func TestSet(t *testing.T) { + t.Parallel() store := NewUsageSecret() secret := &v1.Secret{ ObjectMeta: metav1.ObjectMeta{ @@ -25,6 +26,7 @@ func TestSet(t *testing.T) { } func TestDelete(t *testing.T) { + t.Parallel() store := NewUsageSecret() secret := &v1.Secret{ ObjectMeta: metav1.ObjectMeta{ @@ -42,6 +44,7 @@ func TestDelete(t *testing.T) { } func TestGetCredentials(t *testing.T) { + t.Parallel() store := NewUsageSecret() secret := &v1.Secret{ ObjectMeta: metav1.ObjectMeta{