Thread

Commits

  1. Fix failures with TAP tests of pg_ctl on Windows

  1. Failure in TAP tests of pg_ctl on Windows with parallel instance set

    Michael Paquier <michael@paquier.xyz> — 2019-12-02T03:14:44Z

    Hi all,
    
    I have run the TAP tests with an instance of Postgres locally set at
    port 5432 on Windows, to notice that 001_start_stop.pl fails various
    tests because the test tries to use the default port for the node
    initialized with pg_ctl.  The problem can get fixed easily by
    assigning a random port number to that instance.
    
    It could potentially become a problem if parallel TAP tests run in
    parallel on Windows while initializing the node because of a port
    conflict, but that's actually already a problem now for all the tests
    as all nodes listen to 127.0.0.1 in this case.  This cannot happen on
    *nix simply because we use a unique unix domain path, so even if ports
    conflict things are able to work. 
    
    Attached is a patch to fix this issue, that I would like to
    back-patch down to 9.4 where the issue can show up.
    
    Any objections?
    --
    Michael
    
  2. Re: Failure in TAP tests of pg_ctl on Windows with parallel instance set

    Andrew Dunstan <andrew.dunstan@2ndquadrant.com> — 2019-12-02T12:57:31Z

    On 12/1/19 10:14 PM, Michael Paquier wrote:
    > Hi all,
    >
    > I have run the TAP tests with an instance of Postgres locally set at
    > port 5432 on Windows, to notice that 001_start_stop.pl fails various
    > tests because the test tries to use the default port for the node
    > initialized with pg_ctl.  The problem can get fixed easily by
    > assigning a random port number to that instance.
    >
    > It could potentially become a problem if parallel TAP tests run in
    > parallel on Windows while initializing the node because of a port
    > conflict, but that's actually already a problem now for all the tests
    > as all nodes listen to 127.0.0.1 in this case.  This cannot happen on
    > *nix simply because we use a unique unix domain path, so even if ports
    > conflict things are able to work. 
    >
    > Attached is a patch to fix this issue, that I would like to
    > back-patch down to 9.4 where the issue can show up.
    >
    > Any objections?
    
    
    
    Looks reasonable. I wonder if there are other test sets where we need to
    set the port.
    
    
    cheers
    
    
    andrew
    
    -- 
    Andrew Dunstan                https://www.2ndQuadrant.com
    PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
    
    
    
    
    
  3. Re: Failure in TAP tests of pg_ctl on Windows with parallel instance set

    Michael Paquier <michael@paquier.xyz> — 2019-12-03T04:03:01Z

    On Mon, Dec 02, 2019 at 07:57:31AM -0500, Andrew Dunstan wrote:
    > Looks reasonable.
    
    Thanks, committed and back-patched down to 11, which is where we have
    PostgresNode::get_free_port.  This could go further down with more
    refactoring of PostgresNode.pm but as it took a long time to find this
    issue that does not seem really worth the extra legwork.
    
    > I wonder if there are other test sets where we need to set the port.
    
    I looked at that before sending the first email, with the tests of
    initdb and pg_basebackup potentially breaking stuff, but we never
    initialize (direct initdb) and then start a node without
    PostgresNode.pm.  So we are fine as far as I saw.
    --
    Michael