mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-15 05:32:25 +03:00
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:
parent
08b9940dde
commit
fbc4477be0
20 changed files with 1374 additions and 527 deletions
24
vendor/src/github.com/lib/pq/notify_test.go
vendored
24
vendor/src/github.com/lib/pq/notify_test.go
vendored
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue