Skip to content

Commit

Permalink
[chore] Fix datadog receiver flakey test. (open-telemetry#23336)
Browse files Browse the repository at this point in the history
* Use random address

* Bind to localhost interface
  • Loading branch information
MovieStoreGuy authored Jun 14, 2023
1 parent 9f854da commit 16df49f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/otelcontribcol/receivers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azuremonitorreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/chronyreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jmxreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver"
Expand Down Expand Up @@ -157,6 +158,11 @@ func TestDefaultReceivers(t *testing.T) {
},
{
receiver: "datadog",
getConfigFn: func() component.Config {
cfg := rcvrFactories["datadog"].CreateDefaultConfig().(*datadogreceiver.Config)
cfg.Endpoint = "localhost:0" // Using a randomly assigned address
return cfg
},
},
{
receiver: "docker_stats",
Expand Down

0 comments on commit 16df49f

Please sign in to comment.