aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-11-10 12:30:01 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2017-11-10 12:30:01 -0500
commit7e60e678615b1f803ac73faee71cca79ec310d1d (patch)
treef8f78d25317ea0f8412f57554641df3ff16b8a2e
parentb9941d3468505aea8bfdd74840b753ed27b9d29f (diff)
downloadpostgresql-7e60e678615b1f803ac73faee71cca79ec310d1d.tar.gz
postgresql-7e60e678615b1f803ac73faee71cca79ec310d1d.zip
Tighten test in contrib/bloom/t/001_wal.pl.
Make bloom WAL test compare psql output text, not just result codes; this was evidently the intent all along, but it was mis-coded. In passing, make sure we will notice any failure in setup steps. Alexander Korotkov, reviewed by Michael Paquier and Masahiko Sawada Discussion: https://postgr.es/m/CAPpHfdtohPdQ9rc5mdWjxq+3VsBNw534KV_5O65dTQrSdVJNgw@mail.gmail.com
-rw-r--r--contrib/bloom/t/001_wal.pl18
1 files changed, 9 insertions, 9 deletions
diff --git a/contrib/bloom/t/001_wal.pl b/contrib/bloom/t/001_wal.pl
index dbba198254e..1b319c993c9 100644
--- a/contrib/bloom/t/001_wal.pl
+++ b/contrib/bloom/t/001_wal.pl
@@ -32,8 +32,8 @@ SELECT * FROM tst WHERE i = 7 AND t = 'e';
);
# Run test queries and compare their result
- my $master_result = $node_master->psql("postgres", $queries);
- my $standby_result = $node_standby->psql("postgres", $queries);
+ my $master_result = $node_master->safe_psql("postgres", $queries);
+ my $standby_result = $node_standby->safe_psql("postgres", $queries);
is($master_result, $standby_result, "$test_name: query result matches");
}
@@ -54,12 +54,12 @@ $node_standby->init_from_backup($node_master, $backup_name,
$node_standby->start;
# Create some bloom index on master
-$node_master->psql("postgres", "CREATE EXTENSION bloom;");
-$node_master->psql("postgres", "CREATE TABLE tst (i int4, t text);");
-$node_master->psql("postgres",
+$node_master->safe_psql("postgres", "CREATE EXTENSION bloom;");
+$node_master->safe_psql("postgres", "CREATE TABLE tst (i int4, t text);");
+$node_master->safe_psql("postgres",
"INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series(1,100000) i;"
);
-$node_master->psql("postgres",
+$node_master->safe_psql("postgres",
"CREATE INDEX bloomidx ON tst USING bloom (i, t) WITH (col1 = 3);");
# Test that queries give same result
@@ -68,12 +68,12 @@ test_index_replay('initial');
# Run 10 cycles of table modification. Run test queries after each modification.
for my $i (1 .. 10)
{
- $node_master->psql("postgres", "DELETE FROM tst WHERE i = $i;");
+ $node_master->safe_psql("postgres", "DELETE FROM tst WHERE i = $i;");
test_index_replay("delete $i");
- $node_master->psql("postgres", "VACUUM tst;");
+ $node_master->safe_psql("postgres", "VACUUM tst;");
test_index_replay("vacuum $i");
my ($start, $end) = (100001 + ($i - 1) * 10000, 100000 + $i * 10000);
- $node_master->psql("postgres",
+ $node_master->safe_psql("postgres",
"INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series($start,$end) i;"
);
test_index_replay("insert $i");