From c281ee3b61e8ab53ff118866d72618ae8cce582b Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 13 Mar 2017 12:54:22 -0400 Subject: Updating server dependancies. Also adding github.com/jaytaylor/html2text and gopkg.in/gomail.v2 (#5748) --- vendor/github.com/lib/pq/notify_test.go | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'vendor/github.com/lib/pq/notify_test.go') 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) { -- cgit v1.2.3-1-g7c22