]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
test: mark more tests as 'timing'
authorAugustin Trancart <augustin.trancart@oslandia.com>
Thu, 26 Sep 2024 08:32:26 +0000 (10:32 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 29 Sep 2024 21:25:41 +0000 (23:25 +0200)
When the machine is under load, any tests relying on a timeout or a sleep is
subject to fail. Let's mark some of them as 'timing'.

tests/test_notify.py
tests/test_notify_async.py

index e8bf6c91c611b85032b0f40efa8b9cae8e37a813..6bce3f9b2455fffe550058941a62d9069b7802c7 100644 (file)
@@ -133,6 +133,7 @@ def test_notify_timeout(conn_cls, conn, dsn):
 
 
 @pytest.mark.slow
+@pytest.mark.timing
 def test_notify_timeout_0(conn_cls, conn, dsn):
     conn.set_autocommit(True)
     conn.execute("listen foo")
@@ -149,6 +150,7 @@ def test_notify_timeout_0(conn_cls, conn, dsn):
 
 
 @pytest.mark.slow
+@pytest.mark.timing
 def test_stop_after(conn_cls, conn, dsn):
     conn.set_autocommit(True)
     conn.execute("listen foo")
@@ -175,6 +177,7 @@ def test_stop_after(conn_cls, conn, dsn):
     assert ns[0].payload == "3"
 
 
+@pytest.mark.timing
 def test_stop_after_batch(conn_cls, conn, dsn):
     conn.set_autocommit(True)
     conn.execute("listen foo")
@@ -196,6 +199,7 @@ def test_stop_after_batch(conn_cls, conn, dsn):
 
 
 @pytest.mark.slow
+@pytest.mark.timing
 def test_notifies_blocking(conn):
 
     def listener():
index 97e1628462247615e22ba9488dd47aac2aec6bee..aca0a7eb61da8ad0afdd3045feeef3f235c052cd 100644 (file)
@@ -130,6 +130,7 @@ async def test_notify_timeout(aconn_cls, aconn, dsn):
 
 
 @pytest.mark.slow
+@pytest.mark.timing
 async def test_notify_timeout_0(aconn_cls, aconn, dsn):
     await aconn.set_autocommit(True)
     await aconn.execute("listen foo")
@@ -146,6 +147,7 @@ async def test_notify_timeout_0(aconn_cls, aconn, dsn):
 
 
 @pytest.mark.slow
+@pytest.mark.timing
 async def test_stop_after(aconn_cls, aconn, dsn):
     await aconn.set_autocommit(True)
     await aconn.execute("listen foo")
@@ -172,6 +174,7 @@ async def test_stop_after(aconn_cls, aconn, dsn):
     assert ns[0].payload == "3"
 
 
+@pytest.mark.timing
 async def test_stop_after_batch(aconn_cls, aconn, dsn):
     await aconn.set_autocommit(True)
     await aconn.execute("listen foo")
@@ -193,6 +196,7 @@ async def test_stop_after_batch(aconn_cls, aconn, dsn):
 
 
 @pytest.mark.slow
+@pytest.mark.timing
 async def test_notifies_blocking(aconn):
     async def listener():
         async for _ in aconn.notifies(timeout=1):