diff --git a/adapters/iam_test.go b/adapters/iam_test.go index 7ecd97c6..09d62481 100644 --- a/adapters/iam_test.go +++ b/adapters/iam_test.go @@ -16,18 +16,18 @@ type TestIAMClient struct{} func TestMain(m *testing.M) { // Add tracing if present key, _ := os.LookupEnv("HONEYCOMB_API_KEY") - opts := make([]otlptracehttp.Option, 0) if key != "" { - opts = []otlptracehttp.Option{ + opts := []otlptracehttp.Option{ otlptracehttp.WithEndpoint("api.honeycomb.io"), otlptracehttp.WithHeaders(map[string]string{"x-honeycomb-team": key}), } - } - if err := tracing.InitTracing(opts...); err != nil { - log.Fatal(err) + if err := tracing.InitTracing(opts...); err != nil { + log.Fatal(err) + } + defer tracing.ShutdownTracing() + } - defer tracing.ShutdownTracing() os.Exit(m.Run()) }