Thread

Commits

  1. Fix portability issue in TAP tests of psql for locales

  1. broken regress tests on fedora 36

    Pavel Stehule <pavel.stehule@gmail.com> — 2022-06-07T08:52:45Z

    Hi
    
    pgbench tests fails, probably due using  czech locale
    
    All tests successful.
    Files=2, Tests=633,  7 wallclock secs ( 0.14 usr  0.02 sys +  1.91 cusr
     1.05 csys =  3.12 CPU)
    Result: PASS
    make[2]: Opouští se adresář
    „/home/pavel/src/postgresql.master/src/bin/pgbench“
    make -C psql check
    make[2]: Vstupuje se do adresáře
    „/home/pavel/src/postgresql.master/src/bin/psql“
    echo "+++ tap check in src/bin/psql +++" && rm -rf
    '/home/pavel/src/postgresql.master/src/bin/psql'/tmp_check &&
    /usr/bin/mkdir -p
    '/home/pavel/src/postgresql.master/src/bin/psql'/tmp_check && cd . &&
    TESTDIR='/home/pavel/src/postgresql.master/src/bin/psql'
    PATH="/home/pavel/src/postgresql.master/tmp_install/usr/local/pgsql/master/bin:/home/pavel/src/postgresql.master/src/bin/psql:$PATH"
    LD_LIBRARY_PATH="/home/pavel/src/postgresql.master/tmp_install/usr/local/pgsql/master/lib"
     PGPORT='65432'
    PG_REGRESS='/home/pavel/src/postgresql.master/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 ........... 15/?
    #   Failed test '\timing with successful query: matches'
    #   at t/001_basic.pl line 83.
    #                   '1
    # Time: 0,717 ms'
    #     doesn't match '(?^m:^1$
    # ^Time: \d+\.\d\d\d ms)'
    
    #   Failed test '\timing with query error: timing output appears'
    #   at t/001_basic.pl line 95.
    #                   'Time: 0,293 ms'
    #     doesn't match '(?^m:^Time: \d+\.\d\d\d ms)'
    # Looks like you failed 2 tests of 58.
    t/001_basic.pl ........... Dubious, test returned 2 (wstat 512, 0x200)
    Failed 2/58 subtests
    t/010_tab_completion.pl .. ok
    t/020_cancel.pl .......... ok
    
    Test Summary Report
    -------------------
    t/001_basic.pl         (Wstat: 512 (exited 2) Tests: 58 Failed: 2)
      Failed tests:  28, 30
      Non-zero exit status: 2
    Files=3, Tests=146,  6 wallclock secs ( 0.07 usr  0.01 sys +  3.15 cusr
     1.14 csys =  4.37 CPU)
    Result: FAIL
    make[2]: *** [Makefile:87: check] Chyba 1
    make[2]: Opouští se adresář „/home/pavel/src/postgresql.master/src/bin/psql“
    make[1]: *** [Makefile:43: check-psql-recurse] Chyba 2
    make[1]: Opouští se adresář „/home/pavel/src/postgresql.master/src/bin“
    make: *** [GNUmakefile:71: check-world-src/bin-recurse] Chyba 2
    
    Regards
    
    Pavel
    
  2. Re: broken regress tests on fedora 36

    Michael Paquier <michael@paquier.xyz> — 2022-06-07T12:56:02Z

    On Tue, Jun 07, 2022 at 10:52:45AM +0200, Pavel Stehule wrote:
    > #   Failed test '\timing with query error: timing output appears'
    > #   at t/001_basic.pl line 95.
    > #                   'Time: 0,293 ms'
    > #     doesn't match '(?^m:^Time: \d+\.\d\d\d ms)'
    > # Looks like you failed 2 tests of 58.
    
    Fun.  The difference is in the separator: dot vs comma.  This should
    fail with French the same way.  Perhaps it would fail differently in
    other languages?  There is no need to be that precise with the regex
    IMO, so I would just cut the regex with the number, checking only the
    unit at the end.
    --
    Michael
    
  3. Re: broken regress tests on fedora 36

    Andrew Dunstan <andrew@dunslane.net> — 2022-06-07T14:54:07Z

    On 2022-06-07 Tu 08:56, Michael Paquier wrote:
    > On Tue, Jun 07, 2022 at 10:52:45AM +0200, Pavel Stehule wrote:
    >> #   Failed test '\timing with query error: timing output appears'
    >> #   at t/001_basic.pl line 95.
    >> #                   'Time: 0,293 ms'
    >> #     doesn't match '(?^m:^Time: \d+\.\d\d\d ms)'
    >> # Looks like you failed 2 tests of 58.
    > Fun.  The difference is in the separator: dot vs comma.  This should
    > fail with French the same way.  Perhaps it would fail differently in
    > other languages?  There is no need to be that precise with the regex
    > IMO, so I would just cut the regex with the number, checking only the
    > unit at the end.
    
    
    or just replace '\.' with '[.,]'
    
    
    cheers
    
    
    andrew
    
    --
    Andrew Dunstan
    EDB: https://www.enterprisedb.com
    
    
    
    
    
  4. Re: broken regress tests on fedora 36

    Michael Paquier <michael@paquier.xyz> — 2022-06-07T23:59:10Z

    On Tue, Jun 07, 2022 at 10:54:07AM -0400, Andrew Dunstan wrote:
    > On 2022-06-07 Tu 08:56, Michael Paquier wrote:
    >> On Tue, Jun 07, 2022 at 10:52:45AM +0200, Pavel Stehule wrote:
    >>> #   Failed test '\timing with query error: timing output appears'
    >>> #   at t/001_basic.pl line 95.
    >>> #                   'Time: 0,293 ms'
    >>> #     doesn't match '(?^m:^Time: \d+\.\d\d\d ms)'
    >>> # Looks like you failed 2 tests of 58.
    >> Fun.  The difference is in the separator: dot vs comma.  This should
    >> fail with French the same way.  Perhaps it would fail differently in
    >> other languages?  There is no need to be that precise with the regex
    >> IMO, so I would just cut the regex with the number, checking only the
    >> unit at the end.
    > 
    > or just replace '\.' with '[.,]'
    
    I was wondering about other separators actually:
    https://en.wikipedia.org/wiki/Decimal_separator#Usage_worldwide
    
    These two should be enough, though.  So changing only that sounds fine
    by me.
    --
    Michael
    
  5. Re: broken regress tests on fedora 36

    Peter Eisentraut <peter.eisentraut@enterprisedb.com> — 2022-06-09T13:41:08Z

    On 07.06.22 14:56, Michael Paquier wrote:
    > On Tue, Jun 07, 2022 at 10:52:45AM +0200, Pavel Stehule wrote:
    >> #   Failed test '\timing with query error: timing output appears'
    >> #   at t/001_basic.pl line 95.
    >> #                   'Time: 0,293 ms'
    >> #     doesn't match '(?^m:^Time: \d+\.\d\d\d ms)'
    >> # Looks like you failed 2 tests of 58.
    > 
    > Fun.  The difference is in the separator: dot vs comma.  This should
    > fail with French the same way.  Perhaps it would fail differently in
    > other languages?  There is no need to be that precise with the regex
    > IMO, so I would just cut the regex with the number, checking only the
    > unit at the end.
    
    Shouldn't we reset the locale setting (LC_NUMERIC?) to a known value? 
    We clearly already do that for other categories, or it wouldn't say "Time:".
    
    
    
    
  6. Re: broken regress tests on fedora 36

    Tom Lane <tgl@sss.pgh.pa.us> — 2022-06-09T15:25:14Z

    Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
    > Shouldn't we reset the locale setting (LC_NUMERIC?) to a known value? 
    > We clearly already do that for other categories, or it wouldn't say "Time:".
    
    pg_regress.c and Utils.pm force LC_MESSAGES to C, explaining
    
    	 * Set translation-related settings to English; otherwise psql will
    	 * produce translated messages and produce diffs.
    
    While that seems clearly necessary, I'm inclined to think that we
    should not mess with the user's LC_XXX environment more than we
    absolutely must.  pg_regress only resets the rest of that if you
    say --no-locale, an option the TAP infrastructure lacks.
    
    In short, I think the committed fix is better than this proposal.
    
    			regards, tom lane