From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Remove pgbench "progress" test pending solution of its timing is
Date: Wed, 21 Nov 2018 16:16:25 -0300
Message-ID: <20181121191625.wdxreoju622dnmfg@alvherre.pgsql> (raw)
In-Reply-To: <alpine.DEB.2.20.1709241113210.4999@lancre>
Here's a rebased version of this patch. This is not an endorsement of
it -- I just used it to locally increase coverage for the doCustom
refactoring patch I'm about to push.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Attachments:pgbench-tap-fix-5.patch (text/x-diff, 2.9K) download
commit 0ea9811717c93ef76ac212899a4597bc5370ce0d[m
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
AuthorDate: Wed Nov 21 16:02:53 2018 -0300
CommitDate: Wed Nov 21 16:11:59 2018 -0300
submitted
diff --git a/src/bin/pgbench/t/001_pgbench_with_server.pl b/src/bin/pgbench/t/001_pgbench_with_server.plindex 89678e7f3f..82adeac9ea 100644--- a/src/bin/pgbench/t/001_pgbench_with_server.pl+++ b/src/bin/pgbench/t/001_pgbench_with_server.pl@@ -4,19 +4,21 @@ use warnings;
use PostgresNode;
use TestLib;
use Test::More;
+use Time::HiRes qw(time);
# start a pgbench specific server
my $node = get_new_node('main');
$node->init;
$node->start;
-# invoke pgbench+# invoke pgbench, return elapsed time
sub pgbench
{
local $Test::Builder::Level = $Test::Builder::Level + 1;
my ($opts, $stat, $out, $err, $name, $files) = @_;
my @cmd = ('pgbench', split /\s+/, $opts);
+ my $t0;
my @filenames = ();
if (defined $files)
{
@@ -40,12 +42,13 @@ sub pgbench
append_to_file($filename, $$files{$fn});
}
}
+ $t0 = time();
$node->command_checks_all(\@cmd, $stat, $out, $err, $name);
# cleanup?
#unlink @filenames or die "cannot unlink files (@filenames): $!";
- return;+ return time() - $t0;
}
# Test concurrent insertion into table with serial column. This
@@ -837,7 +840,49 @@ sub check_pgbench_logs
my $bdir = $node->basedir;
-# with sampling rate+# note: --progress-timestamp is not tested++# The point of this test is coverage of various time-related features+# (-T, -P, --aggregate-interval, --rate, --latency-limit...), so it is+# somehow time sensitive.+# The checks performed are quite loose so as to still pass even under+# degraded (high load, slow host, valgrind run) testing conditions.+# Maybe it might fail if no every second progress report is+# shown over 2 seconds...+my $elapsed = pgbench(+ '-T 2 -P 1 -l --log-prefix=001_pgbench_log_1 --aggregate-interval=1'+ . ' -S -b se@2 --rate=20 --latency-limit=1000 -j '+ . $nthreads+ . ' -c 3 -r',+ 0,+ [+ qr{type: multiple},+ qr{clients: 3},+ qr{threads: $nthreads},+ # the shown duration is really -T argument value+ qr{duration: 2 s},+ qr{script 1: .* select only},+ qr{script 2: .* select only},+ qr{statement latencies in milliseconds},+ qr{FROM pgbench_accounts}+ ],+ [+ qr{vacuum},+ # hopefully at least expect some progress report?+ qr{progress: \d\b}+ ],+ 'pgbench progress');++# if the test has gone AWOL, coldly skip these detailed checks.+if (abs($elapsed - 2.0) < 0.5)+{+ # $nthreads threads, 2 seconds, but due to timing imprecision we might get+ # only 1 or as many as 3 progress reports per thread.+ check_pgbench_logs('001_pgbench_log_1', $nthreads, 1, 3,+ qr{^\d+ \d{1,2} \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+$});+}++# with sampling rate, not time sensitive
pgbench(
"-n -S -t 50 -c 2 --log --log-prefix=$bdir/001_pgbench_log_2 --sampling-rate=0.5",
0,
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: alvherre@2ndquadrant.com, coelho@cri.ensmp.fr, tgl@sss.pgh.pa.us
Subject: Re: [COMMITTERS] pgsql: Remove pgbench "progress" test pending solution of its timing is
In-Reply-To: <20181121191625.wdxreoju622dnmfg@alvherre.pgsql>
References: <alpine.DEB.2.20.1709241113210.4999@lancre> <20181121191625.wdxreoju622dnmfg@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox