From 851a1f8bbecfd557d4ca76e71907431595f6bee0 Mon Sep 17 00:00:00 2001 From: chahat sagar <109112505+chahatsagarmain@users.noreply.github.com> Date: Mon, 11 Nov 2024 23:50:51 +0530 Subject: [PATCH] Parallelize the unit tests (#6191) ## Which problem is this PR solving? - Part of #6111 ## Description of the changes - Added t.parallel to tests where it made significant improvement ## How was this change tested? - ## Checklist - [ ] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [ ] I have signed all commits - [ ] I have added unit tests for the new functionality - [ ] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` Signed-off-by: chahatsagarmain --- cmd/agent/app/builder_test.go | 1 + cmd/agent/app/reporter/grpc/builder_test.go | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/agent/app/builder_test.go b/cmd/agent/app/builder_test.go index fa7bc913487..1e896f28481 100644 --- a/cmd/agent/app/builder_test.go +++ b/cmd/agent/app/builder_test.go @@ -223,6 +223,7 @@ func TestCreateCollectorProxy(t *testing.T) { for _, test := range tests { t.Run("", func(t *testing.T) { + t.Parallel() flags := &flag.FlagSet{} grpc.AddFlags(flags) reporter.AddFlags(flags) diff --git a/cmd/agent/app/reporter/grpc/builder_test.go b/cmd/agent/app/reporter/grpc/builder_test.go index 9eb4ebdea33..1643fb2960a 100644 --- a/cmd/agent/app/reporter/grpc/builder_test.go +++ b/cmd/agent/app/reporter/grpc/builder_test.go @@ -300,10 +300,12 @@ func TestProxyClientTLS(t *testing.T) { expectError: false, }, } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() + for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() var opts []grpc.ServerOption if test.serverTLS.Enabled { tlsCfg, err := test.serverTLS.Config(zap.NewNop())