Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e94f2bc

Browse files
committed
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
1 parent fd1a421 commit e94f2bc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/bin/pgbench/t/001_pgbench_with_server.pl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,24 +605,26 @@ sub check_pgbench_logs
605605
ok(unlink(@logs), "remove log files");
606606
}
607607

608+
my $bdir = $node->basedir;
609+
608610
# with sampling rate
609611
pgbench(
610-
'-n -S -t 50 -c 2 --log --log-prefix=001_pgbench_log_2 --sampling-rate=0.5',
612+
"-n -S -t 50 -c 2 --log --log-prefix=$bdir/001_pgbench_log_2 --sampling-rate=0.5",
611613
0,
612614
[ qr{select only}, qr{processed: 100/100} ],
613615
[qr{^$}],
614616
'pgbench logs');
615617

616-
check_pgbench_logs('001_pgbench_log_2', 1, 8, 92,
618+
check_pgbench_logs("$bdir/001_pgbench_log_2", 1, 8, 92,
617619
qr{^0 \d{1,2} \d+ \d \d+ \d+$});
618620

619621
# check log file in some detail
620622
pgbench(
621-
'-n -b se -t 10 -l --log-prefix=001_pgbench_log_3',
623+
"-n -b se -t 10 -l --log-prefix=$bdir/001_pgbench_log_3",
622624
0, [ qr{select only}, qr{processed: 10/10} ],
623625
[qr{^$}], 'pgbench logs contents');
624626

625-
check_pgbench_logs('001_pgbench_log_3', 1, 10, 10,
627+
check_pgbench_logs("$bdir/001_pgbench_log_3", 1, 10, 10,
626628
qr{^\d \d{1,2} \d+ \d \d+ \d+$});
627629

628630
# done

0 commit comments

Comments
 (0)