Re: psql tests hangs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Kirk Wolak <wolakk(at)gmail(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Subject: Re: psql tests hangs
Date: 2023-05-12 17:28:04
Message-ID: 1526620.1683912484@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> pá 12. 5. 2023 v 17:50 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:
>> OK. So after looking at this a bit, the reason PAGER and PSQL_PAGER
>> don't cause us any problems in the test environment is that they are
>> not honored unless isatty(fileno(stdin)) && isatty(fileno(stdout)).
>> It seems to me that it's a bug that there is no such check before
>> using PSQL_WATCH_PAGER. Is there actually any defensible reason
>> for that?

> Theoretically, we can write tests for these features, and then stdout,
> stdin may not be tty.

Well, you'd test using pty's, so that psql thinks it's talking to a
terminal. That's what we're doing now to test tab completion,
for example.

> Except for testing, using pager in non-interactive mode makes no sense.

Agreed. Let's solve this by inserting isatty tests in psql, rather
than hacking the test environment.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ryan Booz 2023-05-12 17:36:27 Re: Overhauling "Routine Vacuuming" docs, particularly its handling of freezing
Previous Message MARK CALLAGHAN 2023-05-12 16:41:33 Re: Large files for relations