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 false positive goleak test #5315

Merged
merged 2 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 5 additions & 5 deletions pkg/cassandra/gocql/testutils/udt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/gocql/gocql"

"github.com/jaegertracing/jaeger/pkg/cassandra/gocql/testutils"
goleakTestutils "github.com/jaegertracing/jaeger/pkg/testutils"
gocqlutils "github.com/jaegertracing/jaeger/pkg/cassandra/gocql/testutils"
"github.com/jaegertracing/jaeger/pkg/testutils"
)

// CustomUDT is a custom type that implements gocql.UDTMarshaler and gocql.UDTUnmarshaler interfaces.
Expand Down Expand Up @@ -49,7 +49,7 @@ func TestUDTTestCase(t *testing.T) {
}

// Define UDT fields for testing
udtFields := []testutils.UDTField{
udtFields := []gocqlutils.UDTField{
{
Name: "Field1",
Type: gocql.TypeBigInt,
Expand All @@ -71,7 +71,7 @@ func TestUDTTestCase(t *testing.T) {
}

// Create a UDTTestCase
testCase := testutils.UDTTestCase{
testCase := gocqlutils.UDTTestCase{
Obj: udtInstance,
ObjName: "CustomUDT",
New: func() gocql.UDTUnmarshaler { return &CustomUDT{} },
Expand All @@ -82,5 +82,5 @@ func TestUDTTestCase(t *testing.T) {
}

func TestMain(m *testing.M) {
goleakTestutils.VerifyGoLeaks(m)
testutils.VerifyGoLeaks(m)
}
8 changes: 5 additions & 3 deletions pkg/testutils/leakcheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package testutils
package testutils_test

import (
"testing"

"github.com/jaegertracing/jaeger/pkg/testutils"
)

func TestVerifyGoLeaksOnce(t *testing.T) {
defer VerifyGoLeaksOnce(t)
defer testutils.VerifyGoLeaksOnce(t)
}

func TestMain(m *testing.M) {
VerifyGoLeaks(m)
testutils.VerifyGoLeaks(m)
}
Loading