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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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 Content-Type Size
pgregress-port-number.diff text/plain 6.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rob Kirkbride 2008-11-27 11:29:10 Re: Enhancement to pg_dump
Previous Message Peter Eisentraut 2008-11-27 09:37:48 Re: Thread safety