aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-03-02 14:48:26 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2018-03-02 14:48:26 -0500
commite94f2bc809a0c684185666f19d81f6496e732a3a (patch)
treee24db31d39ee84b8a13fa3fe826633f9e57b9179 /src
parentfd1a421fe66173fb9b85d3fe150afde8e812cbe4 (diff)
downloadpostgresql-e94f2bc809a0c684185666f19d81f6496e732a3a.tar.gz
postgresql-e94f2bc809a0c684185666f19d81f6496e732a3a.zip
Fix pgbench TAP test to work in VPATH builds.
Previously, it'd try to create log files under the source directory not the build directory. This fell over if the source isn't writable by the building user. Fabien Coelho Discussion: https://postgr.es/m/alpine.DEB.2.20.1801101038340.2283@lancre
Diffstat (limited to 'src')
-rw-r--r--src/bin/pgbench/t/001_pgbench_with_server.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bin/pgbench/t/001_pgbench_with_server.pl b/src/bin/pgbench/t/001_pgbench_with_server.pl
index e585220dc08..0c23d2fc583 100644
--- a/src/bin/pgbench/t/001_pgbench_with_server.pl
+++ b/src/bin/pgbench/t/001_pgbench_with_server.pl
@@ -605,24 +605,26 @@ sub check_pgbench_logs
ok(unlink(@logs), "remove log files");
}
+my $bdir = $node->basedir;
+
# with sampling rate
pgbench(
-'-n -S -t 50 -c 2 --log --log-prefix=001_pgbench_log_2 --sampling-rate=0.5',
+"-n -S -t 50 -c 2 --log --log-prefix=$bdir/001_pgbench_log_2 --sampling-rate=0.5",
0,
[ qr{select only}, qr{processed: 100/100} ],
[qr{^$}],
'pgbench logs');
-check_pgbench_logs('001_pgbench_log_2', 1, 8, 92,
+check_pgbench_logs("$bdir/001_pgbench_log_2", 1, 8, 92,
qr{^0 \d{1,2} \d+ \d \d+ \d+$});
# check log file in some detail
pgbench(
- '-n -b se -t 10 -l --log-prefix=001_pgbench_log_3',
+ "-n -b se -t 10 -l --log-prefix=$bdir/001_pgbench_log_3",
0, [ qr{select only}, qr{processed: 10/10} ],
[qr{^$}], 'pgbench logs contents');
-check_pgbench_logs('001_pgbench_log_3', 1, 10, 10,
+check_pgbench_logs("$bdir/001_pgbench_log_3", 1, 10, 10,
qr{^\d \d{1,2} \d+ \d \d+ \d+$});
# done