]> Cypherpunks repositories - gostls13.git/commit
database/sql: deflake TestPendingConnsAfterErr and fix races, panics
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 28 Jun 2016 19:06:08 +0000 (12:06 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 28 Jun 2016 21:37:53 +0000 (21:37 +0000)
commit733aefd06e5cf708637308a4ad7a048aa97db5cd
treefe3cdeca10dc1171045f3e6d18431becfaf30608
parent069289180816e2f8b40ad6f9e167dc5071cefcdf
database/sql: deflake TestPendingConnsAfterErr and fix races, panics

TestPendingConnsAfterErr only cared that things didn't deadlock, so 5
seconds is a sufficient timer. We don't need 100 milliseconds.

I was able to reproduce with a tiny (5 nanosecond) timeout value,
instead of 100 milliseconds. In the process of testing with -race and
a high -count= value, I noticed several data races and panics
(sendings on a closed channel) which are also fixed in this change.

Fixes #15684

Change-Id: Ib4605fcc0f296e658cb948352ed642b801cb578c
Reviewed-on: https://go-review.googlesource.com/24550
Reviewed-by: Marko Tiikkaja <marko@joh.to>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
src/database/sql/sql.go
src/database/sql/sql_test.go