Fix pgbench TAP tests to work with --disable-thread-safety.
Probably matters to nobody but me; but I'd like to still be able to get through the TAP tests on gaur/pademelon, from time to time.
This commit is contained in:
parent
c1602c7a1b
commit
2cf15ec8b1
|
@ -126,9 +126,18 @@ pgbench(
|
||||||
qr{receiving}, qr{executing} ],
|
qr{receiving}, qr{executing} ],
|
||||||
'pgbench select only');
|
'pgbench select only');
|
||||||
|
|
||||||
|
# check if threads are supported
|
||||||
|
my $nthreads = 2;
|
||||||
|
|
||||||
|
{
|
||||||
|
my ($stderr);
|
||||||
|
run_log([ 'pgbench', '-j', '2', '--bad-option' ], '2>', \$stderr);
|
||||||
|
$nthreads = 1 if $stderr =~ 'threads are not supported on this platform';
|
||||||
|
}
|
||||||
|
|
||||||
# run custom scripts
|
# run custom scripts
|
||||||
pgbench(
|
pgbench(
|
||||||
'-t 100 -c 1 -j 2 -M prepared -n',
|
"-t 100 -c 1 -j $nthreads -M prepared -n",
|
||||||
0,
|
0,
|
||||||
[ qr{type: multiple scripts},
|
[ qr{type: multiple scripts},
|
||||||
qr{mode: prepared},
|
qr{mode: prepared},
|
||||||
|
@ -439,11 +448,12 @@ sub check_pgbench_logs
|
||||||
# note: --progress-timestamp is not tested
|
# note: --progress-timestamp is not tested
|
||||||
pgbench(
|
pgbench(
|
||||||
'-T 2 -P 1 -l --log-prefix=001_pgbench_log_1 --aggregate-interval=1'
|
'-T 2 -P 1 -l --log-prefix=001_pgbench_log_1 --aggregate-interval=1'
|
||||||
. ' -S -b se@2 --rate=20 --latency-limit=1000 -j 2 -c 3 -r',
|
. ' -S -b se@2 --rate=20 --latency-limit=1000 -j ' . $nthreads
|
||||||
|
. ' -c 3 -r',
|
||||||
0,
|
0,
|
||||||
[ qr{type: multiple},
|
[ qr{type: multiple},
|
||||||
qr{clients: 3},
|
qr{clients: 3},
|
||||||
qr{threads: 2},
|
qr{threads: $nthreads},
|
||||||
qr{duration: 2 s},
|
qr{duration: 2 s},
|
||||||
qr{script 1: .* select only},
|
qr{script 1: .* select only},
|
||||||
qr{script 2: .* select only},
|
qr{script 2: .* select only},
|
||||||
|
@ -452,8 +462,8 @@ pgbench(
|
||||||
[ qr{vacuum}, qr{progress: 1\b} ],
|
[ qr{vacuum}, qr{progress: 1\b} ],
|
||||||
'pgbench progress');
|
'pgbench progress');
|
||||||
|
|
||||||
# 2 threads 2 seconds, sometimes only one aggregated line is written
|
# $nthreads threads, 2 seconds, sometimes only one aggregated line is written
|
||||||
check_pgbench_logs('001_pgbench_log_1', 2, 1, 2,
|
check_pgbench_logs('001_pgbench_log_1', $nthreads, 1, 2,
|
||||||
qr{^\d+ \d{1,2} \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+$});
|
qr{^\d+ \d{1,2} \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+$});
|
||||||
|
|
||||||
# with sampling rate
|
# with sampling rate
|
||||||
|
|
Loading…
Reference in New Issue