Re: psql tests hangs

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Kirk Wolak <wolakk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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 12:39:41
Message-ID: CAFj8pRBFe-uq8UteSDZ3pNavmRpgNeGh0vhGQNeUwtksGkCpDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pá 12. 5. 2023 v 10:31 odesílatel Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
napsal:

>
>
> pá 12. 5. 2023 v 9:46 odesílatel Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
> napsal:
>
>> On 2023-May-12, Pavel Stehule wrote:
>>
>> > It hangs in perl
>>
>> I wonder if "hanging" actually means that it interpreted the sleep time
>> as a very large integer, so it's just sleeping for a long time.
>>
>
> There is some interaction with pspg in stream mode
>
> The probable scenario
>
> It is starting pspg due to my setting PSQL_WATCH_PAGER. pspg is waiting on
> quit command, or on pipe ending. Quit command cannot to come because it is
> not on tty, so it is dead lock
>
> I can write to safeguard the fast ending on pspg when it is in stream
> mode, and tty is not available.
>
> And generally, the root perl should to reset PSQL_WATCH_PAGER env variable
> before executing psql. Probably it does with PSQL_PAGER, and maybe with
> PAGER.
>

with last change in pspg, this tests fails as "expected"

aster/src/bin/psql/../../../src/test/regress/pg_regress' /usr/bin/prove -I
../../../src/test/perl/ -I . t/*.pl
# +++ tap check in src/bin/psql +++
t/001_basic.pl ........... 59/?
# Failed test '\watch with 3 iterations: no stderr'
# at t/001_basic.pl line 356.
# got: 'stream mode can be used only in interactive mode (tty is
not available)'
# expected: ''

# Failed test '\watch with 3 iterations: matches'
# at t/001_basic.pl line 356.
# ''
# doesn't match '(?^l:1\n1\n1)'
# Looks like you failed 2 tests of 80.
t/001_basic.pl ........... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/80 subtests
t/010_tab_completion.pl .. ok
t/020_cancel.pl .......... ok

Test Summary Report
-------------------
t/001_basic.pl (Wstat: 512 (exited 2) Tests: 80 Failed: 2)
Failed tests: 69-70
Non-zero exit status: 2
Files=3, Tests=169, 7 wallclock secs ( 0.16 usr 0.03 sys + 3.31 cusr
1.31 csys = 4.81 CPU)
Result: FAIL
make: *** [Makefile:87: check] Chyba 1

Regards

Pavel

>
> Regards
>
> Pavel
>
>
>>
>> About the server locale, note that the ->new() call explicitly requests
>> the C locale -- it's only psql that is using the Czech locale.
>> Supposedly, the Perl code should also be using the Czech locale, so the
>> sprintf('%g') should be consistent with what psql \watch expects.
>> However, you cannot ask the server to be consistent with that -- say, if
>> you hypothetically tried to use "to_char(9D99)" and \gset that to use as
>> \watch argument, it wouldn't work, because that'd use the server's C
>> locale, not Czech. (I know because I tried.)
>>
>> --
>> Álvaro Herrera Breisgau, Deutschland —
>> https://www.EnterpriseDB.com/
>> "Puedes vivir sólo una vez, pero si lo haces bien, una vez es suficiente"
>>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-05-12 13:26:27 Re: psql tests hangs
Previous Message Bharath Rupireddy 2023-05-12 11:58:25 Re: walsender performance regression due to logical decoding on standby changes