|
| 1 | +// Copyright The OpenTelemetry Authors |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +package docsgen |
| 5 | + |
| 6 | +import ( |
| 7 | + "testing" |
| 8 | + |
| 9 | + "go.uber.org/goleak" |
| 10 | +) |
| 11 | + |
| 12 | +// The Ignore function calls prevent catching leaks generated by indirect dependencies. |
| 13 | +// All of these are leaks that we can't fix from within the collector code base. |
| 14 | +// Regarding the OpenCensus ignore: see https://github.com/census-instrumentation/opencensus-go/issues/1191 |
| 15 | +// Regarding the DataDog ignore: see https://github.com/DataDog/datadog-agent/issues/22030 |
| 16 | +// Regarding the database/sql ignore: see https://github.com/SAP/go-hdb/issues/130 |
| 17 | +// Regarding the SAP/go-hdb ignore: see https://github.com/SAP/go-hdb/issues/131 |
| 18 | +// Regarding the cihub/seelog ignore: see https://github.com/cihub/seelog/issues/182 |
| 19 | +// Regarding the godbus/dbus ignore: see https://github.com/99designs/keyring/issues/135 |
| 20 | +func TestMain(m *testing.M) { |
| 21 | + goleak.VerifyTestMain(m, |
| 22 | + goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"), |
| 23 | + goleak.IgnoreTopFunction("github.com/DataDog/datadog-agent/pkg/trace/metrics/timing.(*Set).Autoreport.func1"), |
| 24 | + // Unfortunately this ignore can't be anymore specific, even though it's caused by the SAP/go-hdb/driver |
| 25 | + // package. There's no reference to this package in the goleak output. This has the potential of |
| 26 | + // hiding future leaks, so we should remove as soon as the referenced issue is resolved. |
| 27 | + goleak.IgnoreTopFunction("database/sql.(*DB).connectionOpener"), |
| 28 | + goleak.IgnoreTopFunction("github.com/SAP/go-hdb/driver.(*metrics).collect"), |
| 29 | + goleak.IgnoreAnyFunction("github.com/cihub/seelog.(*asyncLoopLogger).processQueue"), |
| 30 | + goleak.IgnoreAnyFunction("github.com/godbus/dbus.(*Conn).inWorker")) |
| 31 | +} |
0 commit comments