]> Cypherpunks repositories - gostls13.git/commitdiff
database/sql: make tests repeatable with -cpu=n,n
authorAlberto GarcĂ­a Hierro <alberto@garciahierro.com>
Thu, 17 Oct 2013 16:02:32 +0000 (09:02 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 17 Oct 2013 16:02:32 +0000 (09:02 -0700)
New test added in CL 14611045 causes a deadlock when
running the tests with -cpu=n,n because the fakedb
driver always waits when opening a new connection after
running TestConnectionLeak.  Reset its state after.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/14780043

src/pkg/database/sql/fakedb_test.go

index 2ed1364759b9e1406a866782970d48dbd1702915..a8adfdd9424b15e52072bc32e7a40f4cbb9a2758 100644 (file)
@@ -151,6 +151,8 @@ func (d *fakeDriver) Open(dsn string) (driver.Conn, error) {
        if d.waitCh != nil {
                d.waitingCh <- struct{}{}
                <-d.waitCh
+               d.waitCh = nil
+               d.waitingCh = nil
        }
        return conn, nil
 }