Skip to content

Commit

Permalink
[chore][receiver/googlecloudspannerreceiver] Enable goleak checks
Browse files Browse the repository at this point in the history
  • Loading branch information
crobert-1 committed Apr 11, 2024
1 parent 5bf55b1 commit 81ea789
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
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 filter

import (
"testing"

"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m)
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func TestFilterBuilder_BuildFilterByMetricPositiveTotalLimit(t *testing.T) {
assert.Equal(t, expectedLimit, f.TotalLimit())
assert.Equal(t, expectedLimit, f.LimitByTimestamp())
}
assert.NoError(t, f.Shutdown())
}
}
})
Expand Down Expand Up @@ -147,6 +148,7 @@ func TestFilterBuilder_HandleLowCardinalityGroups(t *testing.T) {
assert.Equal(t, expectedLimit, f.TotalLimit())
assert.Equal(t, expectedLimit, f.LimitByTimestamp())
assert.Equal(t, testCase.expectedRemainingTotalLimit, remainingTotalLimit)
assert.NoError(t, f.Shutdown())
}
}
})
Expand Down Expand Up @@ -200,6 +202,7 @@ func TestFilterBuilder_HandleHighCardinalityGroups(t *testing.T) {
assert.Equal(t, testCase.expectedHighCardinalityTotalLimit, f.TotalLimit())
assert.Equal(t, testCase.expectedHighCardinalityLimitByTimestamp, f.LimitByTimestamp())
assert.Equal(t, testCase.expectedRemainingTotalLimit, remainingTotalLimit)
assert.NoError(t, f.Shutdown())
}
}
})
Expand Down Expand Up @@ -234,6 +237,7 @@ func TestFilterBuilder_TestConstructFiltersForGroups(t *testing.T) {
assert.Equal(t, totalLimitPerMetric, f.TotalLimit())
assert.Equal(t, limitPerMetricByTimestamp, f.LimitByTimestamp())
assert.Equal(t, expectedRemainingTotalLimit, result)
assert.NoError(t, f.Shutdown())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func TestNewItemFilterResolver(t *testing.T) {
require.Nil(t, factory)
} else {
require.NoError(t, err)
require.NoError(t, factory.Shutdown())
}
})
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package filterfactory

import (
"testing"

"go.uber.org/goleak"
)

// See https://github.com/census-instrumentation/opencensus-go/issues/1191 for more information on ignore.
func TestMain(m *testing.M) {
goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package statsreader

import (
"testing"

"go.uber.org/goleak"
)

// See https://github.com/census-instrumentation/opencensus-go/issues/1191 for more information on ignore.
func TestMain(m *testing.M) {
goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"))
}

0 comments on commit 81ea789

Please sign in to comment.