diff --git a/pgconn/pgconn_test.go b/pgconn/pgconn_test.go index e91f699a..3d89cca7 100644 --- a/pgconn/pgconn_test.go +++ b/pgconn/pgconn_test.go @@ -3632,6 +3632,7 @@ func TestCancelRequestContextWatcherHandler(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), 4*time.Millisecond) defer cancel() pgConn.Exec(ctx, "select 1, pg_sleep(0.010)").ReadAll() + time.Sleep(100 * time.Millisecond) // ensure a cancel request that was a little late doesn't interrupt ensureConnValid. ensureConnValid(t, pgConn) }() }