Brittleness in regression test setup

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Brittleness in regression test setup
Date: 2008-11-14 15:28:53
Message-ID: 491D9935.9010200@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have experienced some brittleness in the regression test setup that
causes the tests to be run against a different server instance or fail
in confusing ways when you have multiple instances running.

For some historic reasons, I have my local scripts set up so that they
build development instances using the hardcoded port 65432. This will
cause a temp install regression test to attempt to use port 565432 which
will be rejected silently by pg_regress, which will then use its
hardcoded default 65432 (no relation to my 65432). If I have some other
instance already running on 65432, then this will fail in non-reassuring
ways such as

============== removing existing temp installation ==============
============== creating temporary installation ==============
============== initializing database system ==============
============== starting postmaster ==============
running on port 65432 with pid 94178
============== creating database "regression" ==============
ERROR: database "regression" already exists

It evidently failed to realize that there is another postmaster already
running at that port and just ran its test setup routines against that
other instance.

If there is no database named "regression" on that other instance, then
it will happily go ahead and run its full test suite against that other
instance.

I see two problems here:

1) It fails to realize that it could not start its own temp instance
when another instance is already running.

2) It ignores the port specification almost silently.

Since ports above 49152 are for private use, I think it is valid to
configure test instances in that port range, but our regression test
setup does not handle that port range very well.

So even if I configured my local scripts to use ports that are all
different from each other and from 65432, this problem would still exist.

So, also,

2a) It has an undocumented hardcoded default port.

Any thoughts on how to fix this?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonah H. Harris 2008-11-14 15:34:55 Re: Simple postgresql.conf wizard
Previous Message Tom Lane 2008-11-14 15:12:52 Re: CREATE AGGREGATE disallows STYPE = internal