pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Add minimal sleep to stats isolation test functions.
5+ messages / 1 participants
[nested] [flat]

* pgsql: Add minimal sleep to stats isolation test functions.
@ 2025-09-25 17:29  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2025-09-25 17:29 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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 <mbanck@gmx.net>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/68d413a3.a70a0220.24c74c.8be9@mx.google.com
Backpatch-through: 15

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b4ef835f5e7d66c9a72f8e6c011cf68ed4907f0b

Modified Files
--------------
src/test/isolation/specs/stats.spec | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Add minimal sleep to stats isolation test functions.
@ 2025-09-25 17:29  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2025-09-25 17:29 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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 <mbanck@gmx.net>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/68d413a3.a70a0220.24c74c.8be9@mx.google.com
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fa42213d4af6bc0dce5b8e9bffeef9afa20b8dd8

Modified Files
--------------
src/test/isolation/specs/stats.spec | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Add minimal sleep to stats isolation test functions.
@ 2025-09-25 17:29  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2025-09-25 17:29 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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 <mbanck@gmx.net>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/68d413a3.a70a0220.24c74c.8be9@mx.google.com
Backpatch-through: 15

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/21ada43a6105bee3093d636d2ba2afc71bebe5a1

Modified Files
--------------
src/test/isolation/specs/stats.spec | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Add minimal sleep to stats isolation test functions.
@ 2025-09-25 17:29  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2025-09-25 17:29 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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 <mbanck@gmx.net>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/68d413a3.a70a0220.24c74c.8be9@mx.google.com
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(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Add minimal sleep to stats isolation test functions.
@ 2025-09-25 17:29  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2025-09-25 17:29 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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 <mbanck@gmx.net>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/68d413a3.a70a0220.24c74c.8be9@mx.google.com
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e849bd551c323a384f2b14d20a1b7bfaa6127ed7

Modified Files
--------------
src/test/isolation/specs/stats.spec | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2025-09-25 17:29 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-09-25 17:29 pgsql: Add minimal sleep to stats isolation test functions. Tom Lane <tgl@sss.pgh.pa.us>
2025-09-25 17:29 pgsql: Add minimal sleep to stats isolation test functions. Tom Lane <tgl@sss.pgh.pa.us>
2025-09-25 17:29 pgsql: Add minimal sleep to stats isolation test functions. Tom Lane <tgl@sss.pgh.pa.us>
2025-09-25 17:29 pgsql: Add minimal sleep to stats isolation test functions. Tom Lane <tgl@sss.pgh.pa.us>
2025-09-25 17:29 pgsql: Add minimal sleep to stats isolation test functions. Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox