Fix undefined cancel

pull/456/head
Valery Krivchikov 2018-09-15 14:27:29 +03:00
parent c844a2402b
commit 0468c97a7e
1 changed files with 2 additions and 2 deletions

View File

@ -1553,7 +1553,7 @@ func TestListenNotify(t *testing.T) {
}
// when timeout occurs
ctx, cancel = context.WithTimeout(context.Background(), time.Millisecond)
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond)
defer cancel()
notification, err = listener.WaitForNotification(ctx)
if err != context.DeadlineExceeded {
@ -1711,7 +1711,7 @@ func TestListenNotifySelfNotification(t *testing.T) {
t.Fatalf("Unexpected error on Query: %v", rows.Err())
}
ctx, cancel = context.WithTimeout(context.Background(), time.Second)
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
notification, err = conn.WaitForNotification(ctx)
if err != nil {