pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_rewind TAP tests won't run in 'remote' mode
2+ messages / 2 participants
[nested] [flat]

* pg_rewind TAP tests won't run in 'remote' mode
@ 2015-04-07 07:22 Kingter Wang <tew@vmware.com>
  2015-04-08 13:54 ` Re: pg_rewind TAP tests won't run in 'remote' mode Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Kingter Wang @ 2015-04-07 07:22 UTC (permalink / raw)
  To: pgsql-bugs; +Cc: kingter wang <kingter@gmail.com>

Logged by: Kingter Wang
Email address: kingter(at)gmail(dot)com
PostgreSQL version: 9.5
Operating system: RHEL 6.4 64bit
Description:

pg_rewind TAP tests always run in 'local' mode, even when specify test mode to 'remote'.

Symptom
========
See  pg_rewind test output on console:
The pg_rewind test still run in local mode, when pass test mode as 'remote':

$cd src/bin/pg_rewind/
$make check
...
... prove -I ../../../src/test/perl/ --verbose t/*.pl :: local
t/001_basic.pl .......
1..4
ok 1 - pg_rewind local
...
...
All tests successful.
...
...prove -I ../../../src/test/perl/ --verbose t/*.pl :: remote
t/001_basic.pl .......
1..4
ok 1 - pg_rewind local
...

Analysis:
=======
The issue should be due to wrongly compare string for equality with '==' operator in perl script below.
In perl, to compare string for equality, should use 'eq' operator rather than '==' which used for
compare equality of number. See details in perl document:http://perlmeme.org/howtos/syntax/comparing_values.html

src/bin/pg_rewind/RewindTest.pm:
sub run_pg_rewind
{
...
if ($test_mode == "local")
{
  ...
}
elsif ($test_mode == "remote")
{
...
}
}

attached a simple patch for fix the bug.

Note that, the pg_rewind tests will fail against 'remote' mode.
Current 'make check' can pass is because the pg_rewind tests run the 'local' mode twice,
and  the 'remote' mode was not touched actually.

With the fix, the 'make check' will fail against 'remote' mode.
$make check
...
...prove -I ../../../src/test/perl/ --verbose t/*.pl :: remote
t/001_basic.pl .......
1..4
not ok 1 - pg_rewind remote

#   Failed test 'pg_rewind remote'
#   at RewindTest.pm line 236.
not ok 2 - table content: query result matches
...
not ok 3 - truncation: query result matches
....

Best Regards,
Kingter

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Attachments:

fix_compare_testmode.patch (application/octet-stream, 844B) download diff --git a/src/bin/pg_rewind/RewindTest.pm b/src/bin/pg_rewind/RewindTest.pm index 0f8f4ca7ce0ed1f6f0512c883ba170a731f29b88..2f8770b4efa61d9f925c15934a0c5d0d42fa5abf 100644 --- a/src/bin/pg_rewind/RewindTest.pm +++ b/src/bin/pg_rewind/RewindTest.pm @@ -212,7 +212,7 @@ sub run_pg_rewind # overwritten during the rewind. copy("$test_master_datadir/postgresql.conf", "$testroot/master-postgresql.conf.tmp"); # Now run pg_rewind - if ($test_mode == "local") + if ($test_mode eq "local") { # Do rewind using a local pgdata as source # Stop the master and be ready to perform the rewind @@ -225,7 +225,7 @@ sub run_pg_rewind '>>', $log_path, '2>&1'); ok ($result, 'pg_rewind local'); } - elsif ($test_mode == "remote") + elsif ($test_mode eq "remote") { # Do rewind using a remote connection as source my $result =
^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: pg_rewind TAP tests won't run in 'remote' mode
  2015-04-07 07:22 pg_rewind TAP tests won't run in 'remote' mode Kingter Wang <tew@vmware.com>
@ 2015-04-08 13:54 ` Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2015-04-08 13:54 UTC (permalink / raw)
  To: Kingter Wang <tew@vmware.com>; pgsql-bugs; +Cc: kingter wang <kingter@gmail.com>

On 4/7/15 3:22 AM, Kingter Wang wrote:
> Logged by: Kingter Wang
> Email address: kingter(at)gmail(dot)com
> PostgreSQL version: 9.5
> Operating system: RHEL 6.4 64bit
> Description:
> 
> pg_rewind TAP tests always run in 'local' mode, even when specify test
> mode to 'remote’.

Yes, we already discovered that and are discussing a fix (on -hackers).



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-04-08 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-04-07 07:22 pg_rewind TAP tests won't run in 'remote' mode Kingter Wang <tew@vmware.com>
2015-04-08 13:54 ` Peter Eisentraut <peter_e@gmx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox