Re: [PATCH] pgbench tap tests fail if the path contains a perl special character

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Raúl Marín Rodríguez <rmrodriguez(at)carto(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] pgbench tap tests fail if the path contains a perl special character
Date: 2019-01-21 09:50:44
Message-ID: alpine.DEB.2.21.1901210834280.2246@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Tom,

> Hm, so bowerbird (a Windows machine) has been failing the pgbench tests
> since this went in, cf
>
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=bowerbird&dt=2019-01-20%2004%3A57%3A01
>
> I'm just guessing, but I suspect that bowerbird is using a path spec that
> includes a backslash directory separator and that's somehow bollixing
> things.

This point is unclear from the log, where plain slashes are used in the
log prefix path, and furthermore no strange characters appear in the
log prefix path:

# Running: pgbench -n -S -t 50 -c 2 --log --log-prefix=G:/prog/bf/root/HEAD/pgsql.build/src/bin/pgbench/tmp_check/t_001_pgbench_with_server_main_data/001_pgbench_log_2 --sampling-rate=0.5
ok 345 - pgbench logs status (got 0 vs expected 0)
ok 346 - pgbench logs stdout /(?^:select only)/
ok 347 - pgbench logs stdout /(?^:processed: 100/100)/
ok 348 - pgbench logs stderr /(?^:^$)/
not ok 349 - number of log files

> If so, we might be able to fix it by converting backslashes to
> forward slashes before applying quotemeta().
>
> It's also possible that on Windows, "glob" handles backslashes
> differently than it does elsewhere, which would be harder to fix
> --- that would bring back my original fear that the appropriate
> quoting rules are different for "glob" than for regexes.

I'm afraid it could indeed be due to platform-specific behavior, so
testing on the target machine to understand the actual behavior would
help.

I just tested the current version on my laptop within a directory
containing spaces and other misc chars: Pgbench TAP tests are currently
broken in this context on master, and this may be used to a collection of
issues, not just one, eg pgbench function splits parameters on spaces
which breaks if there are spaces in bdir.

I'm going to investigate, possibly over next week-end, so please be
patient.

About windows-specific issues, from File::Glob man page:

""" On DOSISH systems, backslash is a valid directory separator character.
In this case, use of backslash as a quoting character (via GLOB_QUOTE)
interferes with the use of backslash as a directory separator. ... """

It seems to suggest that quotemeta backslash-on-nearly-everything approach
is not appropriate.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2019-01-21 10:20:33 Re: New vacuum option to do only freezing
Previous Message Michael Paquier 2019-01-21 09:14:53 Re: Allowing extensions to find out the OIDs of their member objects