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

database/sql: TestPendingConnsAfterErr flaky on darwin/arm64 #15684

Closed
eliasnaur opened this issue May 14, 2016 · 7 comments
Closed

database/sql: TestPendingConnsAfterErr flaky on darwin/arm64 #15684

eliasnaur opened this issue May 14, 2016 · 7 comments

Comments

@eliasnaur
Copy link
Contributor

@eliasnaur eliasnaur commented May 14, 2016

darwin/arm64 regularly fails with:

--- FAIL: TestPendingConnsAfterErr (0.01s)

sql_test.go:147: 1 connections still open after closing DB

FAIL

Process 279 exited with status = 1 (0x00000001)
go_darwin_arm_exec: exited (test completion: exit status 253)
FAIL database/sql 29.053s

Some builder logs:
https://build.golang.org/log/c3fae67a950cd6415bf39ccece80799814852c80
https://build.golang.org/log/fcb2c8b603b28d81ec5ab6ccba4bd12b4da28bce

@mikioh mikioh added the Testing label May 14, 2016
@mikioh mikioh changed the title database/sql TestPendingConnsAfterErr flaky on darwin/arm64 database/sql: TestPendingConnsAfterErr flaky on darwin/arm64 May 14, 2016
@bradfitz bradfitz added this to the Go1.7Maybe milestone May 14, 2016
@eliasnaur
Copy link
Contributor Author

@eliasnaur eliasnaur commented May 25, 2016

Here's a similar recent trace from freebsd/arm:

https://build.golang.org/log/372776e543edae8bfda51d2ec70146a943eb71b6

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 28, 2016

CL https://golang.org/cl/24550 mentions this issue.

@gopherbot gopherbot closed this in 733aefd Jun 28, 2016
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Oct 22, 2016

@kardianos, maybe you can take a look at this too? (if you don't have enough on your plate)

But I figure all this stuff is currently more in your head than mine.

@kardianos
Copy link
Contributor

@kardianos kardianos commented Oct 31, 2016

@bradfitz I'll look into this shortly. Thanks.

@rsc rsc modified the milestones: Go1.9, Go1.8Maybe Nov 11, 2016
@kardianos
Copy link
Contributor

@kardianos kardianos commented Nov 19, 2016

I'm able to reproduce this. By adding the following:

+++ b/src/database/sql/sql_test.go
@@ -1509,6 +1509,7 @@ func TestPendingConnsAfterErr(t *testing.T) {
        unblock := make(chan struct{})
        setHookOpenErr(func() error {
                <-unblock // block until all connections are in flight
+               runtime.Gosched()
                return errOffline
        })

It reliably fails with sql_test.go:148: 1 connections still open after closing DB. However adding runtime.Gosched() to the last line of the func allows the test to pass again (this is all on a std linux amd64 laptop).

My assumption is that we are seeing the failures on slower machines that have slightly different scheduler patterns due to load. I'll look into updating the test soon.

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 20, 2016

CL https://golang.org/cl/33418 mentions this issue.

@gopherbot gopherbot closed this in e12f6ee Nov 22, 2016
@golang golang locked and limited conversation to collaborators Nov 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.