Fix undefined cancel
This commit is contained in:
+2
-2
@@ -1553,7 +1553,7 @@ func TestListenNotify(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// when timeout occurs
|
// when timeout occurs
|
||||||
ctx, cancel = context.WithTimeout(context.Background(), time.Millisecond)
|
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
notification, err = listener.WaitForNotification(ctx)
|
notification, err = listener.WaitForNotification(ctx)
|
||||||
if err != context.DeadlineExceeded {
|
if err != context.DeadlineExceeded {
|
||||||
@@ -1711,7 +1711,7 @@ func TestListenNotifySelfNotification(t *testing.T) {
|
|||||||
t.Fatalf("Unexpected error on Query: %v", rows.Err())
|
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()
|
defer cancel()
|
||||||
notification, err = conn.WaitForNotification(ctx)
|
notification, err = conn.WaitForNotification(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user