Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: TestCreateCollectorProxy unit test failing on go-tip (#6204)
## Which problem is this PR solving? - Resolves #6198 ## Description of the changes - After the addition of `t.Parallel` in `cmd/agent/app/builder_test.go` in `TestCreateCollectorProxy`, its test started to fail during random ittterations. This was because in `/cmd/agent/app/reporter/connect_metrics.go` under `NewConnectMetrics` function we are doing `expvar.NewString("gRPCTarget")` which isnt thread-safe and it should not be changed on initialized - Now we use sync.Once to tackle the above bug/problem ## How was this change tested? - running `go test -v` ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [ ] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` Signed-off-by: Saumya Shah <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]>
- Loading branch information