Re: Inappropriate failure conditions in foreign_data regression test

Lists: pgsql-hackers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Inappropriate failure conditions in foreign_data regression test
Date: 2009-10-02 17:11:31
Message-ID: 5477.1254503491@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

By chance I noticed that the foreign_data regression test fails if run
in an installation where "bob" is a live user. It appears to be
assuming that half a dozen other fairly common names don't belong to
real users, either. Could we make this a little less fragile? Maybe
call them no_such_user_N. Or for that matter do we really need quite
so many tests of the same error condition?

regards, tom lane


From: Martin Pihlak <martin(dot)pihlak(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Inappropriate failure conditions in foreign_data regression test
Date: 2009-10-05 13:25:24
Message-ID: 4AC9F3C4.4060400@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> By chance I noticed that the foreign_data regression test fails if run
> in an installation where "bob" is a live user. It appears to be
> assuming that half a dozen other fairly common names don't belong to
> real users, either. Could we make this a little less fragile? Maybe

Attached is a patch that attempts to fix that -- user mappings are now
created for "regress_test_missing_role" instead of "bob" or "baz".

> call them no_such_user_N. Or for that matter do we really need quite
> so many tests of the same error condition?
>

The code paths leading to those error conditions are different (or at
least they should be). The initial aim was to get as much test coverage
as possible, but I guess the tests could be simplified if this is turning
out to be a maintenance burden

regards,
Martin

Attachment Content-Type Size
foreign_data_regression.patch text/x-diff 5.3 KB

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Martin Pihlak <martin(dot)pihlak(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Inappropriate failure conditions in foreign_data regression test
Date: 2009-10-14 23:36:58
Message-ID: 20091014233658.GH4902@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Martin Pihlak escribió:
> > By chance I noticed that the foreign_data regression test fails if run
> > in an installation where "bob" is a live user. It appears to be
> > assuming that half a dozen other fairly common names don't belong to
> > real users, either. Could we make this a little less fragile? Maybe
>
> Attached is a patch that attempts to fix that -- user mappings are now
> created for "regress_test_missing_role" instead of "bob" or "baz".

Applied, thanks.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support