Attempt to fix unstable regression tests
authorDavid Rowley <[email protected]>
Sun, 29 Mar 2020 06:36:20 +0000 (19:36 +1300)
committerDavid Rowley <[email protected]>
Sun, 29 Mar 2020 06:36:20 +0000 (19:36 +1300)
commit2dc16efedc767aec38368d215eb7695b87a054b5
tree4a7c6b9ad7dc7418d2a1a5328d63490e5a812991
parenta7b9d24e4e00048bf9d99b197996476dcf9492de
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
src/test/regress/expected/partition_aggregate.out
src/test/regress/expected/stats_ext.out
src/test/regress/sql/partition_aggregate.sql
src/test/regress/sql/stats_ext.sql