Re: Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Amir Rohan <amir(dot)rohan(at)zoho(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Greg Smith <gsmith(at)gregsmith(dot)com>
Subject: Re: Re: In-core regression tests for replication, cascading, archiving, PITR, etc.
Date: 2015-12-01 23:11:21
Message-ID: 20151201231121.GI2763@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier wrote:

> OK... I have merged TestLib and PostgresNode of the previous patch
> into PostgresNode into the way suggested by Noah. TestBase has been
> renamed back to TestLib, and includes as well the base test functions
> like command_ok.

Great, thanks. Here's one more version, hopefully the last one.

- I discovered that not setting PGPORT was causing some of the tests
that fail (using command_fails) to fail to test what was being tested.
The problem is that the command was failing with "could not connect to
server" instead of failing because of trying to cluster a nonexistant
table, etc. Unfortunately the only way to verify this is by looking
at the regress_log_xxx_foobar file. Not ideal, but not this patch's
fault.

- I changed the routines moved to PostgresNode so that they are instance
methods, i.e. $node->poll_until_query; also psql and
issues_query_like. The latter also sets "local $PGPORT" so that the
command is run with the correct port.

- It would be nice to have command_ok and command_fails in PostgresNode
too; that would remove the need for setting $ENV{PGPORT} but it's
possible to run commands outside a node too, so we'd need duplicates,
which would be worse.

- I changed start/stop/restart so that they keep track of the postmaster
PID; also added a DESTROY sub to PostgresNode that sends SIGQUIT.
This means that when the test finishes, the server gets an immediate
stop signal. We were getting a lot of errors in the server log about
failing to write to the stats file otherwise, until the node noticed
that the datadir was gone.

- I removed the @active_nodes array, which is now unnecessary (per
above).

- I moved the "delete $ENV{PGxxx}" back to a BEGIN block in TestLib.
I did it because it's possible to write test scripts without
PostgresNode, and it's not nice to have those pick up the environment.
This still affects anything using PostgresNode because that one uses
TestLib.

Finally, I ran perltidy on all the files, which strangely changed stuff
that I didn't expect it to change. I wonder if this is related to the
perltidy version. Do you see further changes if you run perltidy on the
patched tree? This is my version:

$ perltidy --version
This is perltidy, v20140328

Copyright 2000-2014, Steve Hancock

Perltidy is free software and may be copied under the terms of the GNU
General Public License, which is included in the distribution files.

Complete documentation for perltidy can be found using 'man perltidy'
or on the internet at http://perltidy.sourceforge.net.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
20151201_tapcheck_v13.patch text/x-diff 63.6 KB
20151201_tapcheck_v13-2.patch text/x-diff 18.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-12-02 00:01:59 Re: Proposal: Trigonometric functions in degrees
Previous Message Peter Geoghegan 2015-12-01 22:15:14 Re: Rework the way multixact truncations work