]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
test: longer sleep to test for idle timeout exception
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 13 Oct 2025 12:49:59 +0000 (14:49 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 13 Oct 2025 12:49:59 +0000 (14:49 +0200)
The test fails semi-regularly on macOS (probably 5% of the times).

tests/test_connection.py
tests/test_connection_async.py

index 6b7b3e016bb1af01a1b12bdc53e8a76a9a9da571..04ff845b02a101b19f9491ef0ee717a385e2d6c6 100644 (file)
@@ -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")
 
index c22ef3d5073dee2b2016bf28d5cf8681d0c45ae8..74856c570e6ebb07b7e2830192adc98ac91a91e3 100644 (file)
@@ -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")