Add minimal sleep to stats isolation test functions. The functions test_stat_func() and test_stat_func2() had empty function bodies, so that they took very little time to run. This made it possible that on machines with relatively low timer resolution the functions could return before the clock advanced, making the test fail (as seen on buildfarm members fruitcrow and hamerkop).
To avoid that, pg_sleep for 10us during the functions. As far as we can tell, all current hardware has clock resolution much less than that. (The current implementation of pg_sleep will round it up to 1ms anyway, but someday that might get improved.) Author: Michael Banck <[email protected]> Reviewed-by: Tom Lane <[email protected]> Discussion: https://postgr.es/m/[email protected] Backpatch-through: 15 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ef18eeeeaea7f64aadf198875670f9d6e56b52df Modified Files -------------- src/test/isolation/specs/stats.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
