]> git.ipfire.org Git - thirdparty/psycopg.git/commit
test: make sure tests don't hang if default connection points to a closed port
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 2 Jun 2025 10:37:26 +0000 (11:37 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 2 Jun 2025 11:49:42 +0000 (12:49 +0100)
commit57e376e2f03dbcc52ea0028feacef32798272103
tree7ced28fe68b60c88249cfc6cc1d551bab08cc33a
parent6aa81e1c87c33da3f59fd254aaa3c5fab613103f
test: make sure tests don't hang if default connection points to a closed port

They might hang is the server doesn't accept connections on the standard
port.

Tested by forcing the default connection to go to an unresponsive port,
using:

    export PGHOST=192.0.2.1
    export PSYCOPG_TEST_DSN="host=localhost dbname=psycopg_test"

and fixing all the tests hanging because they try to connect to the
unroutable hostname, not taking into account the test dsn.
tests/pq/test_pgconn.py
tests/test_connection.py
tests/test_connection_async.py
tests/test_errors.py
tests/test_gevent.py
tests/test_waiting.py