Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YfUww-0001Uz-BM for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Apr 2015 14:57:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YfUwv-0008M3-Jx for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Apr 2015 14:57:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YfNqb-0002oj-Tk for pgsql-bugs@postgresql.org; Tue, 07 Apr 2015 07:22:58 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YfNqV-0005xn-48 for pgsql-bugs@postgresql.org; Tue, 07 Apr 2015 07:22:56 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 36C4628672; Tue, 7 Apr 2015 00:22:45 -0700 (PDT) Received: from EX13-CAS-013.vmware.com (EX13-CAS-013.vmware.com [10.113.191.65]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 326F5182E2; Tue, 7 Apr 2015 00:22:45 -0700 (PDT) Received: from EX13-MBX-031.vmware.com (10.113.191.71) by EX13-MBX-025.vmware.com (10.113.191.45) with Microsoft SMTP Server (TLS) id 15.0.913.22; Tue, 7 Apr 2015 00:22:40 -0700 Received: from EX13-MBX-022.vmware.com (10.113.191.42) by EX13-MBX-031.vmware.com (10.113.191.71) with Microsoft SMTP Server (TLS) id 15.0.913.22; Tue, 7 Apr 2015 00:22:21 -0700 Received: from EX13-MBX-022.vmware.com ([fe80::68dc:5952:a108:86c]) by EX13-MBX-022.vmware.com ([fe80::68dc:5952:a108:86c%15]) with mapi id 15.00.0913.011; Tue, 7 Apr 2015 00:22:02 -0700 From: Kingter Wang To: "pgsql-bugs@postgresql.org" CC: kingter wang Subject: pg_rewind TAP tests won't run in 'remote' mode Thread-Topic: pg_rewind TAP tests won't run in 'remote' mode Thread-Index: AQHQcQOKogqdO8tZDE60rK95DaQ/Aw== Date: Tue, 7 Apr 2015 07:22:02 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.113.160.246] Content-Type: multipart/mixed; boundary="_004_D149A6981368Dtewvmwarecom_" MIME-Version: 1.0 X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --_004_D149A6981368Dtewvmwarecom_ Content-Type: multipart/alternative; boundary="_000_D149A6981368Dtewvmwarecom_" --_000_D149A6981368Dtewvmwarecom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 =3D=3D=3D=3D=3D=3D=3D=3D 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: =3D=3D=3D=3D=3D=3D=3D The issue should be due to wrongly compare string for equality with '=3D=3D= ' operator in perl script below. In perl, to compare string for equality, should use 'eq' operator rather th= an '=3D=3D' which used for compare equality of number. See details in perl document:http://perlmeme.or= g/howtos/syntax/comparing_values.html src/bin/pg_rewind/RewindTest.pm: sub run_pg_rewind { ... if ($test_mode =3D=3D "local") { ... } elsif ($test_mode =3D=3D "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 --_000_D149A6981368Dtewvmwarecom_ Content-Type: text/html; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable
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
=3D=3D=3D=3D=3D=3D=3D=3D
See  pg_rewind test output on console:
The pg_rewind test still run in local mode, when pass test mode as ‘r= emote’:

$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:
=3D=3D=3D=3D=3D=3D=3D
The issue should be due to wrongly compare string for equality with '=3D=3D= ' operator in perl script below.
In perl, to compare string for equality, should use 'eq' operator rather th= an '=3D=3D' which used for 
compare equality of number. See details in perl document:http://perlmeme.org/howto= s/syntax/comparing_values.html

src/bin/pg_rewind/RewindTest.pm:
sub run_pg_rewind
{
...
if ($test_m= ode =3D=3D "local")
{
  ...
}
elsif ($tes= t_mode =3D=3D "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 ru= n the ‘local’ mode twice,
and  the ‘remote’ mode was not touched actually.

With the fix, the ‘make check’ will fail against ‘remote&= #8217; 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
   
--_000_D149A6981368Dtewvmwarecom_-- --_004_D149A6981368Dtewvmwarecom_ Content-Type: application/octet-stream; name="fix_compare_testmode.patch" Content-Description: fix_compare_testmode.patch Content-Disposition: attachment; filename="fix_compare_testmode.patch"; size=844; creation-date="Tue, 07 Apr 2015 07:22:02 GMT"; modification-date="Tue, 07 Apr 2015 07:22:02 GMT" Content-ID: <02CA5D2294B6AD48A5BACA57196D9713@pa-exch1.vmware.com> Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9iaW4vcGdfcmV3aW5kL1Jld2luZFRlc3QucG0g Yi9zcmMvYmluL3BnX3Jld2luZC9SZXdpbmRUZXN0LnBtCmluZGV4IDBmOGY0 Y2E3Y2UwZWQxZjZmMDUxMmM4ODNiYTE3MGE3MzFmMjliODguLjJmODc3MGI0 ZWZhNjFkOWY5MjVjMTU5MzRhMGM1ZDBkNDJmYTVhYmYgMTAwNjQ0Ci0tLSBh L3NyYy9iaW4vcGdfcmV3aW5kL1Jld2luZFRlc3QucG0KKysrIGIvc3JjL2Jp bi9wZ19yZXdpbmQvUmV3aW5kVGVzdC5wbQpAQCAtMjEyLDcgKzIxMiw3IEBA IHN1YiBydW5fcGdfcmV3aW5kCiAJIyBvdmVyd3JpdHRlbiBkdXJpbmcgdGhl IHJld2luZC4KIAljb3B5KCIkdGVzdF9tYXN0ZXJfZGF0YWRpci9wb3N0Z3Jl c3FsLmNvbmYiLCAiJHRlc3Ryb290L21hc3Rlci1wb3N0Z3Jlc3FsLmNvbmYu dG1wIik7CiAJIyBOb3cgcnVuIHBnX3Jld2luZAotCWlmICgkdGVzdF9tb2Rl ID09ICJsb2NhbCIpCisJaWYgKCR0ZXN0X21vZGUgZXEgImxvY2FsIikKIAl7 CiAJCSMgRG8gcmV3aW5kIHVzaW5nIGEgbG9jYWwgcGdkYXRhIGFzIHNvdXJj ZQogCQkjIFN0b3AgdGhlIG1hc3RlciBhbmQgYmUgcmVhZHkgdG8gcGVyZm9y bSB0aGUgcmV3aW5kCkBAIC0yMjUsNyArMjI1LDcgQEAgc3ViIHJ1bl9wZ19y ZXdpbmQKIAkJCQknPj4nLCAkbG9nX3BhdGgsICcyPiYxJyk7CiAJCW9rICgk cmVzdWx0LCAncGdfcmV3aW5kIGxvY2FsJyk7CiAJfQotCWVsc2lmICgkdGVz dF9tb2RlID09ICJyZW1vdGUiKQorCWVsc2lmICgkdGVzdF9tb2RlIGVxICJy ZW1vdGUiKQogCXsKIAkJIyBEbyByZXdpbmQgdXNpbmcgYSByZW1vdGUgY29u bmVjdGlvbiBhcyBzb3VyY2UKIAkJbXkgJHJlc3VsdCA9Cg== --_004_D149A6981368Dtewvmwarecom_ Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs --_004_D149A6981368Dtewvmwarecom_--