Skip to content

Commit

Permalink
[processor/tailsampling] Cleanly tear down test (#9283)
Browse files Browse the repository at this point in the history
* [processor/tailsampling] Cleanly tear down test

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

* Move goleaks to main require section

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
  • Loading branch information
jpkrohling authored Apr 18, 2022
1 parent 925f8c0 commit ba5cb7d
Show file tree
Hide file tree
Showing 4 changed files with 494 additions and 1 deletion.
5 changes: 5 additions & 0 deletions processor/tailsamplingprocessor/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,9 @@ func TestCreateProcessor(t *testing.T) {
tp, err := factory.CreateTracesProcessor(context.Background(), params, cfg, consumertest.NewNop())
assert.NotNil(t, tp)
assert.NoError(t, err, "cannot create trace processor")

// this will cause the processor to properly initialize, so that we can later shutdown and
// have all the go routines cleanly shut down
assert.NoError(t, tp.Start(context.Background(), componenttest.NewNopHost()))
assert.NoError(t, tp.Shutdown(context.Background()))
}
3 changes: 2 additions & 1 deletion processor/tailsamplingprocessor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ require (
go.opencensus.io v0.23.0
go.opentelemetry.io/collector v0.49.0
go.opentelemetry.io/collector/pdata v0.49.0
go.uber.org/goleak v1.1.11
go.uber.org/zap v1.21.0

)

require (
Expand All @@ -29,6 +29,7 @@ require (
go.opentelemetry.io/otel/trace v1.6.3 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
Expand Down
Loading

0 comments on commit ba5cb7d

Please sign in to comment.