From 2d5b62d99b9940c2dde01e0c50016be46177e970 Mon Sep 17 00:00:00 2001 From: Felipe Lopes Date: Mon, 26 Aug 2024 07:13:10 -0300 Subject: [PATCH] [chore][receiver/datadog] Fix data race detected in tests (#34834) **Description:** Fixes #34823 **Link to tracking Issue:** **Testing:** **Documentation:** --- receiver/datadogreceiver/receiver_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/receiver/datadogreceiver/receiver_test.go b/receiver/datadogreceiver/receiver_test.go index 573e271ba8fa..c671abdf48ff 100644 --- a/receiver/datadogreceiver/receiver_test.go +++ b/receiver/datadogreceiver/receiver_test.go @@ -115,9 +115,6 @@ func TestDatadogServer(t *testing.T) { } func TestDatadogInfoEndpoint(t *testing.T) { - cfg := createDefaultConfig().(*Config) - cfg.Endpoint = "localhost:0" // Using a randomly assigned address - for _, tc := range []struct { name string tracesConsumer consumer.Traces @@ -214,6 +211,9 @@ func TestDatadogInfoEndpoint(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() + cfg := createDefaultConfig().(*Config) + cfg.Endpoint = "localhost:0" // Using a randomly assigned address + dd, err := newDataDogReceiver( cfg, receivertest.NewNopSettings(),