Re: Testing with concurrent sessions

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Testing with concurrent sessions
Date: 2010-01-04 23:29:37
Message-ID: 1262647777.13313.117.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On mån, 2010-01-04 at 17:10 -0600, Kevin Grittner wrote:
> "David E. Wheeler" <david(at)kineticode(dot)com> wrote:
>
> > I think the consensus was, failing support for concurrent sessions
> > in psql, to use a Perl script to control multiple psql sessions
> > and perhaps use Test::More to do the testing.
>
> Are there any examples of that? While I can hack my way through
> regular expressions when I need them, perl as a language is
> something I don't know at all; with an example I might be able to
> come up to speed quickly, though.

If you're not deep into Perl, perhaps ignore the Test::More comment for
the moment and just use DBI to connect to several database sessions,
execute your queries and check if the results are what you want. Once
you have gotten somewhere with that, wrapping a test harness around it
is something others will be able to help with.

> > Although pgTAP might make sense, too, if the
> > tests ought to run in the database.
>
> I need to run statements against a database; I don't particularly
> need any special features of psql for this. Can anyone confirm that
> pgTAP can let you interleave specific statements against specific
> connections in a specific sequence? (The answer to that didn't leap
> out at me in a quick scan of the docs.)

pgTAP isn't really going to help you here, as it runs with *one*
database session, and its main functionality is to format the result of
SQL functions into TAP output, which is not very much like what you
ought to be doing.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2010-01-04 23:38:03 Re: Initial refactoring of plperl.c - rebased [PATCH]
Previous Message Kevin Grittner 2010-01-04 23:10:01 Re: Testing with concurrent sessions