Skip to content

Commit

Permalink
[chore] Add goleak tests for jaeger receiver (open-telemetry#31687)
Browse files Browse the repository at this point in the history
Related to
open-telemetry#30438

Signed-off-by: Israel Blancas <[email protected]>
  • Loading branch information
iblancasa authored Mar 12, 2024
1 parent 2a638ec commit bf40162
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions receiver/jaegerreceiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ require (
go.opentelemetry.io/collector/semconv v0.96.1-0.20240306115632-b2693620eff6
go.opentelemetry.io/otel/metric v1.24.0
go.opentelemetry.io/otel/trace v1.24.0
go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.0
google.golang.org/grpc v1.62.1
Expand Down
8 changes: 3 additions & 5 deletions receiver/jaegerreceiver/jaeger_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,9 @@ func TestJaegerHTTP(t *testing.T) {

resp, err := http.Get(fmt.Sprintf("http://%s/sampling?service=test", endpoint))
assert.NoError(t, err, "should not have failed to make request")
if resp != nil {
assert.Equal(t, 500, resp.StatusCode, "should have returned 200")
return
}
t.Fail()
assert.NotNil(t, resp)
defer resp.Body.Close()
assert.Equal(t, 500, resp.StatusCode, "should have returned 200")
}

func testJaegerAgent(t *testing.T, agentEndpoint string, receiverConfig *configuration) {
Expand Down
14 changes: 14 additions & 0 deletions receiver/jaegerreceiver/package_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package jaegerreceiver

import (
"testing"

"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m)
}

0 comments on commit bf40162

Please sign in to comment.