Use a read-only snapshot transaction for calculating sync responses (#236)

* Use a read-only snapshot transaction for calculating sync responses

* gb vendor update github.com/lib/pq
This commit is contained in:
Mark Haines 2017-09-19 16:22:02 +01:00 committed by GitHub
parent 08b9940dde
commit fbc4477be0
20 changed files with 1374 additions and 527 deletions

View file

@ -7,7 +7,6 @@ import (
"os"
"runtime"
"sync"
"sync/atomic"
"testing"
"time"
)
@ -235,15 +234,10 @@ func TestConnExecDeadlock(t *testing.T) {
// calls Close on the net.Conn; equivalent to a network failure
l.Close()
var done int32 = 0
go func() {
time.Sleep(10 * time.Second)
if atomic.LoadInt32(&done) != 1 {
panic("timed out")
}
}()
defer time.AfterFunc(10*time.Second, func() {
panic("timed out")
}).Stop()
wg.Wait()
atomic.StoreInt32(&done, 1)
}
// Test for ListenerConn being closed while a slow query is executing
@ -271,15 +265,11 @@ func TestListenerConnCloseWhileQueryIsExecuting(t *testing.T) {
if err != nil {
t.Fatal(err)
}
var done int32 = 0
go func() {
time.Sleep(10 * time.Second)
if atomic.LoadInt32(&done) != 1 {
panic("timed out")
}
}()
defer time.AfterFunc(10*time.Second, func() {
panic("timed out")
}).Stop()
wg.Wait()
atomic.StoreInt32(&done, 1)
}
func TestNotifyExtra(t *testing.T) {