summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/lib/pq/notify_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-03-13 12:54:22 -0400
committerGitHub <noreply@github.com>2017-03-13 12:54:22 -0400
commitc281ee3b61e8ab53ff118866d72618ae8cce582b (patch)
tree776e7bdf6c8bfbb9a1dee5976496ab065959991f /vendor/github.com/lib/pq/notify_test.go
parent3ada7a41a7fb13abef19dd63dc56b720900dbaa9 (diff)
downloadchat-c281ee3b61e8ab53ff118866d72618ae8cce582b.tar.gz
chat-c281ee3b61e8ab53ff118866d72618ae8cce582b.tar.bz2
chat-c281ee3b61e8ab53ff118866d72618ae8cce582b.zip
Updating server dependancies. Also adding github.com/jaytaylor/html2text and gopkg.in/gomail.v2 (#5748)
Diffstat (limited to 'vendor/github.com/lib/pq/notify_test.go')
-rw-r--r--vendor/github.com/lib/pq/notify_test.go24
1 files changed, 7 insertions, 17 deletions
diff --git a/vendor/github.com/lib/pq/notify_test.go b/vendor/github.com/lib/pq/notify_test.go
index fe8941a4e..82a77e1eb 100644
--- a/vendor/github.com/lib/pq/notify_test.go
+++ b/vendor/github.com/lib/pq/notify_test.go
@@ -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) {