pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Make postmaster 003_start_stop.pl test less flaky
2+ messages / 1 participants
[nested] [flat]

* pgsql: Make postmaster 003_start_stop.pl test less flaky
@ 2025-12-17 14:46 Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 2+ messages in thread

From: Heikki Linnakangas @ 2025-12-17 14:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Make postmaster 003_start_stop.pl test less flaky

The test is very sensitive to how backends start and exit, because it
tests dead-end backends which occur when all the connection slots are
in use. The test failed occasionally in the CI, when the backend that
was launched for the raw_connect_works() check lingered for a while,
and exited only later during the test. When it exited, it released a
connection slot, when the test expected all the slots to be in use at
that time.

The 002_connection_limits.pl test had a similar issue: if the backend
launched for safe_psql() in the test initialization lingers around, it
uses up a connection slot during the test, messing up the test's
connection counting. I haven't seen that in the CI, but when I added a
"sleep(1);" to proc_exit(), the test failed.

To make the tests more robust, restart the server to ensure that the
lingering backends doesn't interfere with the later test steps.

In the passing, fix a bogus test name.

Report and analysis by Jelte Fennema-Nio, Andres Freund, Thomas Munro.

Discussion: https://www.postgresql.org/message-id/CAGECzQSU2iGuocuP+fmu89hmBmR3tb-TNyYKjCcL2M_zTCkAFw@mail.gmail...
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5cbaa00592d4c1e8ef519bf0d89c415bfa3b3473

Modified Files
--------------
src/test/postmaster/t/002_connection_limits.pl | 5 +++++
src/test/postmaster/t/003_start_stop.pl        | 7 ++++++-
2 files changed, 11 insertions(+), 1 deletion(-)



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

* pgsql: Make postmaster 003_start_stop.pl test less flaky
@ 2025-12-17 14:46 Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 2+ messages in thread

From: Heikki Linnakangas @ 2025-12-17 14:46 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Make postmaster 003_start_stop.pl test less flaky

The test is very sensitive to how backends start and exit, because it
tests dead-end backends which occur when all the connection slots are
in use. The test failed occasionally in the CI, when the backend that
was launched for the raw_connect_works() check lingered for a while,
and exited only later during the test. When it exited, it released a
connection slot, when the test expected all the slots to be in use at
that time.

The 002_connection_limits.pl test had a similar issue: if the backend
launched for safe_psql() in the test initialization lingers around, it
uses up a connection slot during the test, messing up the test's
connection counting. I haven't seen that in the CI, but when I added a
"sleep(1);" to proc_exit(), the test failed.

To make the tests more robust, restart the server to ensure that the
lingering backends doesn't interfere with the later test steps.

In the passing, fix a bogus test name.

Report and analysis by Jelte Fennema-Nio, Andres Freund, Thomas Munro.

Discussion: https://www.postgresql.org/message-id/CAGECzQSU2iGuocuP+fmu89hmBmR3tb-TNyYKjCcL2M_zTCkAFw@mail.gmail...
Backpatch-through: 18

Branch
------
REL_18_STABLE

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

Modified Files
--------------
src/test/postmaster/t/002_connection_limits.pl | 5 +++++
src/test/postmaster/t/003_start_stop.pl        | 7 ++++++-
2 files changed, 11 insertions(+), 1 deletion(-)



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


end of thread, other threads:[~2025-12-17 14:46 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-12-17 14:46 pgsql: Make postmaster 003_start_stop.pl test less flaky Heikki Linnakangas <heikki.linnakangas@iki.fi>
2025-12-17 14:46 pgsql: Make postmaster 003_start_stop.pl test less flaky Heikki Linnakangas <heikki.linnakangas@iki.fi>

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