Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Goroutine leaks in several packages #5066

Merged
merged 11 commits into from
Dec 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ignore glog leak
Signed-off-by: Harshvir Potpose <[email protected]>
  • Loading branch information
akagami-harsh committed Dec 30, 2023
commit b3087304c08d6e9f448d99aa400af6f17b659834
5 changes: 5 additions & 0 deletions cmd/internal/env/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"go.uber.org/goleak"
)

func TestCommand(t *testing.T) {
Expand All @@ -30,3 +31,7 @@ func TestCommand(t *testing.T) {
assert.True(t, strings.Contains(buf.String(), "METRICS_BACKEND"))
assert.True(t, strings.Contains(buf.String(), "SPAN_STORAGE"))
}

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("github.com/golang/glog.(*fileSink).flushDaemon"))
}
11 changes: 11 additions & 0 deletions plugin/storage/badger/dependencystore/package_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package dependencystore

import (
"testing"

"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("github.com/golang/glog.(*fileSink).flushDaemon"))
}
11 changes: 11 additions & 0 deletions plugin/storage/badger/package_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package badger

import (
"testing"

"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("github.com/golang/glog.(*fileSink).flushDaemon"))
}
5 changes: 5 additions & 0 deletions plugin/storage/badger/samplingstore/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/dgraph-io/badger/v3"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/goleak"

samplemodel "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/model"
)
Expand Down Expand Up @@ -139,3 +140,7 @@ func runWithBadger(t *testing.T, test func(t *testing.T, store *SamplingStore))
ss := newTestSamplingStore(store)
test(t, ss)
}

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("github.com/golang/glog.(*fileSink).flushDaemon"))
}
11 changes: 11 additions & 0 deletions plugin/storage/badger/spanstore/package_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package spanstore

import (
"testing"

"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("github.com/golang/glog.(*fileSink).flushDaemon"))
}
2 changes: 2 additions & 0 deletions plugin/storage/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ func TestPublishOpts(t *testing.T) {
require.NoError(t, err)

baseMetrics := metricstest.NewFactory(time.Second)
baseMetrics.Stop()
forkFactory := metricstest.NewFactory(time.Second)
forkFactory.Stop()
metricsFactory := fork.New("internal", forkFactory, baseMetrics)
f.metricsFactory = metricsFactory

Expand Down
11 changes: 11 additions & 0 deletions plugin/storage/package_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package storage

import (
"testing"

"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("github.com/golang/glog.(*fileSink).flushDaemon"))
}