[COMMITTERS] pgsql: Avoid hard-wired sleep delays in stats regression test. - Mailing list pgsql-committers

From Tom Lane
Subject [COMMITTERS] pgsql: Avoid hard-wired sleep delays in stats regression test.
Date
Msg-id E1d9XJH-00060I-GQ@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Avoid hard-wired sleep delays in stats regression test.

On faster machines, the overall runtime for running the core regression
tests is under twenty seconds these days, of which the hard-wired delays
in the stats test are a significant fraction.  But on closer inspection,
it seems like we shouldn't need those.

The initial 2-second delay is there only to reduce the risk of the test's
stats messages not getting sent due to contention.  But analysis of the
last ten years' worth of buildfarm runs shows no evidence that such
failures actually occur.  (We do see failures that look like stats
messages not getting sent, particularly on Windows; but there is little
reason to believe that the initial delay reduces their frequency.)

The later 1-second delay is there to ensure that our session's stats
will have gotten sent.  But we could also do that by starting a fresh
session, which takes well under 1 second even on very slow machines.

Hence, let's remove both delays and see what happens.  The first delay
was the only test of pg_sleep_for() in the regression tests, but we can
move that responsibility into wait_for_stats().

Discussion: https://postgr.es/m/17795.1493869423@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4e37b3e15c4e129dbbcf46e00ad36672f4f7b359

Modified Files
--------------
src/test/regress/expected/stats.out | 28 ++++++++++------------------
src/test/regress/sql/stats.sql      | 19 ++++++++++---------
2 files changed, 20 insertions(+), 27 deletions(-)


pgsql-committers by date:

Previous
From: Andrew Dunstan
Date:
Subject: [COMMITTERS] pgsql: Use a better way of skipping all subscription tests on Windows
Next
From: Robert Haas
Date:
Subject: [COMMITTERS] pgsql: Fix multi-column range partitioning constraints.