pgsql: Attempt to fix unstable regression tests

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Attempt to fix unstable regression tests
Date: 2020-03-29 06:36:46
Message-ID: E1jIRYs-0006ns-OK@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Attempt to fix unstable regression tests

b07642dbc added code to trigger autovacuums based on the number of
inserts into a table. This seems to have caused some regression test
results to destabilize. I suspect this is due to autovacuum triggering a
vacuum sometime after the test's ANALYZE run and perhaps reltuples is
ending up being set to a slightly different value as a result.

Attempt to resolve this by running a VACUUM ANALYZE on the affected table
instead of just ANALYZE. pg_class.reltuples will still get set to whatever
ANALYZE chooses but we should no longer get the proceeding autovacuum
overriding that.

The overhead this adds to each test's runtime seems small enough not to
worry about. I measure 3-4% on stats_ext and can't measure any change in
partition_aggregate.

I'm unable to recreate the issue locally, so this is a bit of a blind
fix.

Discussion: https://postgr.es/m/CAApHDvpWmpqYrKwwDQyeDq8dAyK7GMNaxDhrG69CkSuXoEg%2BVg%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2dc16efedc767aec38368d215eb7695b87a054b5

Modified Files
--------------
src/test/regress/expected/partition_aggregate.out | 2 +-
src/test/regress/expected/stats_ext.out | 12 ++++++------
src/test/regress/sql/partition_aggregate.sql | 2 +-
src/test/regress/sql/stats_ext.sql | 13 ++++++-------
4 files changed, 14 insertions(+), 15 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2020-03-29 07:04:03 pgsql: Update SQL features
Previous Message Peter Geoghegan 2020-03-29 03:25:35 pgsql: Make deduplication use number of key attributes.