[HACKERS] Fix bloom WAL tap test - Mailing list pgsql-hackers

From Alexander Korotkov
Subject [HACKERS] Fix bloom WAL tap test
Date
Msg-id CAPpHfdtohPdQ9rc5mdWjxq+3VsBNw534KV_5O65dTQrSdVJNgw@mail.gmail.com
Whole thread Raw
Responses Re: [HACKERS] Fix bloom WAL tap test  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
List pgsql-hackers
Hi!

I just realized that these lines of contrib/bloom/t/001_wal.pl don't check that queries give same results on master and standby.  They just check that *return codes* of psql are equal.

# Run test queries and compare their result
my $master_result = $node_master->psql("postgres", $queries);
my $standby_result = $node_standby->psql("postgres", $queries);
is($master_result, $standby_result, "$test_name: query result matches");

Attached patch fixes this problem by using safe_psql() which returns psql output instead of return code.  For safety, this patch replaces psql() with safe_psql() in other places too.

I think this should be backpatched to 9.6 as bugfix.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Rewriting the test of pg_upgrade as a TAP test
Next
From: Simon Riggs
Date:
Subject: Re: [HACKERS] [COMMITTERS] pgsql: Add psql variables showing serverversion and psql version.