Skip to content

contrib/gorm.io/gorm.v1: Flaky TestSQLServer #1321

Open
@felixge

Description

@felixge

This test appears flaky, see: https://app.circleci.com/pipelines/github/DataDog/dd-trace-go/3878/workflows/86cd2577-3e4d-43b8-b85c-f943f71b40dc/jobs/27790/tests#failed-test-0

This failure is particularly interesting. Unless we're calling Rows.Close() on a nil pointer, this could be a bug in the stdlib or something of similar interest.

    --- FAIL: TestSQLServer/Query (0.02s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7e1e16]

goroutine 181 [running]:
testing.tRunner.func1.2(0xb35f20, 0x110b7a0)
	/usr/local/go/src/testing/testing.go:1143 +0x332
testing.tRunner.func1(0xc000103980)
	/usr/local/go/src/testing/testing.go:1146 +0x4b6
panic(0xb35f20, 0x110b7a0)
	/usr/local/go/src/runtime/panic.go:965 +0x1b9
database/sql.(*Rows).close(0x0, 0x0, 0x0, 0x0, 0x0)
	/usr/local/go/src/database/sql/sql.go:3165 +0x76
database/sql.(*Rows).Close(0x0, 0xb0cde0, 0xca5ca0)
	/usr/local/go/src/database/sql/sql.go:3161 +0x33
gopkg.in/DataDog/dd-trace-go.v1/contrib/internal/sqltest.testQuery.func1(0xc000103980)
	/home/circleci/dd-trace-go.v1/contrib/internal/sqltest/sqltest.go:151 +0x56f
testing.tRunner(0xc000103980, 0xc0002e9860)
	/usr/local/go/src/testing/testing.go:1193 +0xef
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:1238 +0x2b3

cc @DataDog/tracing-go

See #1320 which is similar (seems like we support to different versions/flavors of gorm?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions