From: Daniele Varrazzo Date: Mon, 13 Oct 2025 12:49:59 +0000 (+0200) Subject: test: longer sleep to test for idle timeout exception X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e8f534ad4fe051fcf23f6703e63ce34f572ea5ed;p=thirdparty%2Fpsycopg.git test: longer sleep to test for idle timeout exception The test fails semi-regularly on macOS (probably 5% of the times). --- diff --git a/tests/test_connection.py b/tests/test_connection.py index 026800e93..6b7ee93b8 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -936,7 +936,7 @@ def test_right_exception_on_session_timeout(conn): want_ex = psycopg.OperationalError conn.execute("SET SESSION idle_in_transaction_session_timeout = 100") - sleep(0.2) + sleep(1) with pytest.raises(want_ex) as ex: conn.execute("SELECT * from pg_tables") diff --git a/tests/test_connection_async.py b/tests/test_connection_async.py index fe85c00a8..8e70947af 100644 --- a/tests/test_connection_async.py +++ b/tests/test_connection_async.py @@ -941,7 +941,7 @@ async def test_right_exception_on_session_timeout(aconn): want_ex = psycopg.OperationalError await aconn.execute("SET SESSION idle_in_transaction_session_timeout = 100") - await asleep(0.2) + await asleep(1) with pytest.raises(want_ex) as ex: await aconn.execute("SELECT * from pg_tables")