Skip to content

Commit

Permalink
[chore][exporter/kafka] Enable goleak check
Browse files Browse the repository at this point in the history
  • Loading branch information
crobert-1 committed Feb 29, 2024
1 parent e778f31 commit 4a58509
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions exporter/kafkaexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func TestCreateMetricExporter(t *testing.T) {
}
assert.NoError(t, err, "Must not error")
assert.NotNil(t, exporter, "Must return valid exporter when no error is returned")
assert.NoError(t, exporter.Shutdown(context.Background()))
})
}
}
Expand Down Expand Up @@ -205,6 +206,7 @@ func TestCreateLogExporter(t *testing.T) {
}
assert.NoError(t, err, "Must not error")
assert.NotNil(t, exporter, "Must return valid exporter when no error is returned")
assert.NoError(t, exporter.Shutdown(context.Background()))
})
}
}
Expand Down Expand Up @@ -279,6 +281,7 @@ func TestCreateTraceExporter(t *testing.T) {
}
assert.NoError(t, err, "Must not error")
assert.NotNil(t, exporter, "Must return valid exporter when no error is returned")
assert.NoError(t, exporter.Shutdown(context.Background()))
})
}
}
1 change: 1 addition & 0 deletions exporter/kafkaexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ require (
go.opentelemetry.io/collector/semconv v0.95.0
go.opentelemetry.io/otel/metric v1.23.1
go.opentelemetry.io/otel/trace v1.23.1
go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.0
)
Expand Down
14 changes: 14 additions & 0 deletions exporter/kafkaexporter/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 kafkaexporter

import (
"testing"

"go.uber.org/goleak"
)

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

0 comments on commit 4a58509

Please sign in to comment.