Re: pgsql: Add tests for reinit.c

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: David Steele <david(at)pgmasters(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Add tests for reinit.c
Date: 2018-03-19 08:15:16
Message-ID: CAD5tBc+V-6BO_8yGK3t8kNSw3pgLpEgYNJef7OMmoq3171_nHg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Sat, Mar 17, 2018 at 12:06 AM, David Steele <david(at)pgmasters(dot)net> wrote:

> On 3/15/18 11:51 PM, Tom Lane wrote:
> > I wrote:
> >> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> >>> Add tests for reinit.c
> >
> >> BTW, buildfarm member jacana hasn't succeeded at this test once.
> >> The failures look like
> >
> >> ok 1 - init fork in base exists
> >> ok 2 - main fork in base exists
> >> error running SQL: 'psql:<stdin>:1: ERROR: directory
> "/home/pgrunner/bf/root/HEAD/pgsql.build/src/test/recovery/tmp_check/tmp_test_wBGG"
> does not exist'
> >> while running 'psql -XAtq -d port=50531 host=127.0.0.1
> dbname='postgres' -f - -v ON_ERROR_STOP=1' with sql 'CREATE TABLESPACE ts1
> LOCATION '/home/pgrunner/bf/root/HEAD/pgsql.build/src/test/recovery/tmp_check/tmp_test_wBGG''
> at /home/pgrunner/bf/root/HEAD/pgsql.build/../pgsql/src/test/perl//PostgresNode.pm
> line 1246.
> >
> >> so I hypothesize that there's something wrong with TestLib::tempdir on
> >> Windows, but no idea what.
> >
> > After further staring at that, I think it's some sort of mingw path
> > weirdness. I notice that the initdb output refers to the PGDATA
> > directory as
> >
> > c:/mingw/msys/1.0/home/pgrunner/bf/root/HEAD/pgsql.
> build/src/test/recovery/tmp_check/t_014_unlogged_reinit_main_data/pgdata
> >
> > and then after that we see "pg_ctl start" succeeding with just
> >
> > /home/pgrunner/bf/root/HEAD/pgsql.build/src/test/recovery/
> tmp_check/t_014_unlogged_reinit_main_data/pgdata
> >
> > but this isn't working:
> >
> > /home/pgrunner/bf/root/HEAD/pgsql.build/src/test/recovery/
> tmp_check/tmp_test_esA3
> >
> > perhaps because it lacks the "c:/mingw/msys/1.0" prefix.
> >
> > Still no opinion about how to fix it.
>
> I looked around for other examples but the only ones I could find are in
> the pg_basebackup tests (010_pg_basebackup.pl), which exclude these
> calls for Windows. I don't have a Windows machine to experiment on.
>
> Michael, any thoughts?
>
>

The attached fixes it. We should probably put the function or something
like it in TestLib.pm, though. The call to pwd is quite tricky - it needs
to be done pretty much exactly like this, not quite sure why, but direct
calls to "pwd -W" via system() or backticks don't work, only this indirect
call works on jacana.

cheers

andrew

Attachment Content-Type Size
tap-test-fix.patch application/octet-stream 922 bytes

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2018-03-19 09:46:16 pgsql: Fix typo in comment
Previous Message Tom Lane 2018-03-18 19:10:54 pgsql: Doc: note that statement-level view triggers require an INSTEAD