On Tue, Mar 31, 2015 at 9:59 AM, Peter Eisentraut <peter_e@gmx.net> wrote:
There are some small issues with the pg_rewind tests.
This technique
check: all $(prove_check) :: local $(prove_check) :: remote
for passing arguments to "prove" does not work with the tools included in Perl 5.8.
While sorting out the portability issues in the TAP framework during the 9.4 release cycle, we had set 5.8 as the oldest Perl version that is supported. (It's the Perl version in RHEL 5.) I suggest using environment variables instead, unless we want to change that.
That's good to know. And I think that by using environment variables it is necessary to pass an additional flag to prove_check (see PG_PROVE_TEST_MODE) in the patch attached because prove_check kicks several instructions, a command mkdir to begin with.
Moreover,
if ($test_mode == "local") ... elsif ($test_mode == "remote")
don't work, because those are numerical comparisons, not string comparisons. So the remote branch is never actually run.
That's "eq" I guess.
Finally, RewindTest.pm should use
use strict; use warnings;
and the warnings caused by that should be addressed.
All those things addressed give more or less the patch attached.
While looking at that I noticed two additional issues:
- In remote mode, the connection string to the promoted standby was incorrect when running pg_rewind, leading to connection errors
- At least in my environment, a sleep of 1 after the standby promotion was not sufficient to make the tests work.