From: Augustin Trancart Date: Thu, 26 Sep 2024 08:32:26 +0000 (+0200) Subject: test: mark more tests as 'timing' X-Git-Tag: 3.2.4~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=99252ceea41e095d9c9461b481df5cada4673fbf;p=thirdparty%2Fpsycopg.git test: mark more tests as 'timing' 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'. --- diff --git a/tests/test_notify.py b/tests/test_notify.py index e8bf6c91c..6bce3f9b2 100644 --- a/tests/test_notify.py +++ b/tests/test_notify.py @@ -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(): diff --git a/tests/test_notify_async.py b/tests/test_notify_async.py index 97e162846..aca0a7eb6 100644 --- a/tests/test_notify_async.py +++ b/tests/test_notify_async.py @@ -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):