Re: psql tests hangs
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, Kirk Wolak <wolakk@gmail.com>,
Daniel Gustafsson <daniel@yesql.se>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Andrey Borodin <x4mmm@yandex-team.ru>
Date: 2023-05-12T17:28:04Z
Lists: pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes: > pá 12. 5. 2023 v 17:50 odesílatel Tom Lane <tgl@sss.pgh.pa.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
Commits
-
Tighten usage of PSQL_WATCH_PAGER.
- bc478a0a85bc 15.4 landed
- 51b2c0879886 16.0 landed
-
Add tab-completion for newly added SUBSCRIPTION options.
- 96c498d2f8ce 16.0 cited
-
psql: add an optional execution-count limit to \watch.
- 00beecfe839c 16.0 cited
-
Handle empty or all-blank PAGER setting more sanely in psql.
- 18f8f784cbbf 10.0 cited