1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-26 03:52:03 +02:00

Use randomly-available port in otlp exporters tests (#2627)

* use randomly-available port in otlp exporters tests

* Update exporters/otlp/otlpmetric/otlpmetricgrpc/client_test.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update exporters/otlp/otlpmetric/otlpmetricgrpc/client_test.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update exporters/otlp/otlpmetric/otlpmetricgrpc/client_test.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update exporters/otlp/otlpmetric/otlpmetricgrpc/client_test.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update exporters/otlp/otlptrace/otlptracegrpc/client_test.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
This commit is contained in:
Damien Mathieu 2022-02-23 00:03:17 +01:00 committed by GitHub
parent 8ba8f68d42
commit d51d1b3090
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -93,7 +93,7 @@ func newGRPCExporter(t *testing.T, ctx context.Context, endpoint string, additio
}
func newExporterEndToEndTest(t *testing.T, additionalOpts []otlpmetricgrpc.Option) {
mc := runMockCollectorAtEndpoint(t, "localhost:56561")
mc := runMockCollector(t)
defer func() {
_ = mc.stop()
@ -115,7 +115,7 @@ func newExporterEndToEndTest(t *testing.T, additionalOpts []otlpmetricgrpc.Optio
}
func TestExporterShutdown(t *testing.T) {
mc := runMockCollectorAtEndpoint(t, "localhost:56561")
mc := runMockCollector(t)
defer func() {
_ = mc.Stop()
}()
@ -296,7 +296,7 @@ func TestStartErrorInvalidAddress(t *testing.T) {
}
func TestEmptyData(t *testing.T) {
mc := runMockCollectorAtEndpoint(t, "localhost:56561")
mc := runMockCollector(t)
defer func() {
_ = mc.stop()
@ -314,7 +314,7 @@ func TestEmptyData(t *testing.T) {
}
func TestFailedMetricTransform(t *testing.T) {
mc := runMockCollectorAtEndpoint(t, "localhost:56561")
mc := runMockCollector(t)
defer func() {
_ = mc.stop()

View File

@ -374,7 +374,7 @@ func TestStartErrorInvalidAddress(t *testing.T) {
}
func TestEmptyData(t *testing.T) {
mc := runMockCollectorAtEndpoint(t, "localhost:56561")
mc := runMockCollector(t)
t.Cleanup(func() { require.NoError(t, mc.stop()) })
<-time.After(5 * time.Millisecond)