pgstat: fix stats.spec instability on slow machines.
authorAndres Freund <andres@anarazel.de>
Sun, 22 May 2022 22:09:50 +0000 (15:09 -0700)
committerAndres Freund <andres@anarazel.de>
Sun, 22 May 2022 22:25:13 +0000 (15:25 -0700)
commit7fdbdf204920ac279f280d0a8e96946fdaf41aef
tree746cbdb34d1706dd05fc30392e588f52af001d9d
parentc7461fc25558832dd347a9c8150b0f1ed85e36e8
pgstat: fix stats.spec instability on slow machines.

On slow machines the modified test could end up switching the order in which
transactional stats are reported in one session and non-transactional stats in
another session. As stats handling of truncate is implemented as setting
live/dead rows 0, the order in which a truncate's stats changes are applied,
relative to normal stats updates, matters. The handling of stats for truncate
hasn't changed due to shared memory stats, this is longstanding behavior.

We might want to improve truncate's stats handling in the future, but for now
just change the order of forced flushed to make the test stable.

Reported-By: Christoph Berg <myon@debian.org>
Discussion: https://postgr.es/m/YoZf7U/WmfmFYFEx@msg.df7cb.de
src/test/isolation/expected/stats.out
src/test/isolation/expected/stats_1.out
src/test/isolation/specs/stats.spec