Skip site navigation (1) Skip section navigation (2)

Re: Brittleness in regression test setup

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Brittleness in regression test setup
Date: 2008-11-27 10:31:05
Message-ID: 492E76E9.4050208@gmx.net (view raw or flat)
Thread:
Lists: pgsql-hackers
Peter Eisentraut wrote:
> Alvaro Herrera wrote:
>> Is it possible to make it retry in case the chosen port is busy?  I
>> guess a simple check should suffice, ignoring the obvious race condition
>> that someone uses the port after you checked it was OK.
> 
> Well, the whole point of this exercise was to avoid that.  If we had a 
> way to do a "simple check", we might as well stick to the hardcoded port 
> and count up from that or something.

Well, duh, the checking is actually pretty simple.  We just try to 
connect with psql to the candidate port number before starting our own 
postmaster and see if anyone is already there.

Patch attached.  It solves my immediate problems nicely.

Attachment: pgregress-port-number.diff
Description: text/plain (6.2 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Rob KirkbrideDate: 2008-11-27 11:29:10
Subject: Re: Enhancement to pg_dump
Previous:From: Peter EisentrautDate: 2008-11-27 09:37:48
Subject: Re: Thread safety

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group