mirror of
https://github.com/golang/go
synced 2024-11-12 09:00:22 -07:00
database/sql: make tests repeatable with -cpu=n,n
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
This commit is contained in:
parent
078bcffcb8
commit
e39eda1366
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user