From: Daniele Varrazzo Date: Mon, 6 Jun 2022 21:59:10 +0000 (+0200) Subject: test(crdb): skip tests based on missing features X-Git-Tag: 3.1~49^2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b196b0c8bd05d95bf3ab1bf39e3ee73c49086ae;p=thirdparty%2Fpsycopg.git test(crdb): skip tests based on missing features With this changeset, all tests pass or are skipped on CRDB 21.2.10 \o/ --- diff --git a/tests/pool/test_null_pool.py b/tests/pool/test_null_pool.py index 69f2a5841..afbdc7572 100644 --- a/tests/pool/test_null_pool.py +++ b/tests/pool/test_null_pool.py @@ -285,6 +285,7 @@ def test_no_queue_timeout(deaf_port): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") def test_queue(dsn): def worker(n): t0 = time() @@ -351,6 +352,7 @@ def test_queue_size(dsn): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") def test_queue_timeout(dsn): def worker(n): t0 = time() @@ -411,6 +413,7 @@ def test_dead_client(dsn): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") def test_queue_timeout_override(dsn): def worker(n): t0 = time() @@ -776,6 +779,7 @@ def test_bad_resize(dsn, min_size, max_size): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") def test_max_lifetime(dsn): pids = [] diff --git a/tests/pool/test_null_pool_async.py b/tests/pool/test_null_pool_async.py index 37f919867..987a35fb3 100644 --- a/tests/pool/test_null_pool_async.py +++ b/tests/pool/test_null_pool_async.py @@ -286,6 +286,7 @@ async def test_no_queue_timeout(deaf_port): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") async def test_queue(dsn): async def worker(n): t0 = time() @@ -344,6 +345,7 @@ async def test_queue_size(dsn): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") async def test_queue_timeout(dsn): async def worker(n): t0 = time() @@ -397,6 +399,7 @@ async def test_dead_client(dsn): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") async def test_queue_timeout_override(dsn): async def worker(n): t0 = time() @@ -736,6 +739,7 @@ async def test_bad_resize(dsn, min_size, max_size): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") async def test_max_lifetime(dsn): pids: List[int] = [] diff --git a/tests/pool/test_pool.py b/tests/pool/test_pool.py index 60c6a04ca..13e161b67 100644 --- a/tests/pool/test_pool.py +++ b/tests/pool/test_pool.py @@ -292,6 +292,7 @@ def test_reset_broken(dsn, caplog): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") def test_queue(dsn): def worker(n): t0 = time() @@ -358,6 +359,7 @@ def test_queue_size(dsn): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") def test_queue_timeout(dsn): def worker(n): t0 = time() @@ -419,6 +421,7 @@ def test_dead_client(dsn): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") def test_queue_timeout_override(dsn): def worker(n): t0 = time() @@ -993,6 +996,7 @@ def test_jitter(): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") def test_max_lifetime(dsn): with pool.ConnectionPool(dsn, min_size=1, max_lifetime=0.2) as p: sleep(0.1) diff --git a/tests/pool/test_pool_async.py b/tests/pool/test_pool_async.py index 46f341a87..dc20dbcd8 100644 --- a/tests/pool/test_pool_async.py +++ b/tests/pool/test_pool_async.py @@ -289,6 +289,7 @@ async def test_reset_broken(dsn, caplog): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") async def test_queue(dsn): async def worker(n): t0 = time() @@ -347,6 +348,7 @@ async def test_queue_size(dsn): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") async def test_queue_timeout(dsn): async def worker(n): t0 = time() @@ -401,6 +403,7 @@ async def test_dead_client(dsn): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") async def test_queue_timeout_override(dsn): async def worker(n): t0 = time() @@ -941,6 +944,7 @@ async def test_jitter(): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="backend pid") async def test_max_lifetime(dsn): async with pool.AsyncConnectionPool(dsn, min_size=1, max_lifetime=0.2) as p: await asyncio.sleep(0.1) diff --git a/tests/test_concurrency.py b/tests/test_concurrency.py index 59920e70f..3b3f2ae11 100644 --- a/tests/test_concurrency.py +++ b/tests/test_concurrency.py @@ -109,6 +109,7 @@ t.join() @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="notify") def test_notifies(conn, dsn): nconn = psycopg.connect(dsn, autocommit=True) npid = nconn.pgconn.backend_pid @@ -161,6 +162,7 @@ def canceller(conn, errors): @pytest.mark.slow +@pytest.mark.crdb("skip", reason="cancel") def test_cancel(conn): errors: List[Exception] = [] @@ -183,6 +185,7 @@ def test_cancel(conn): t.join() +@pytest.mark.crdb("skip", reason="pg_terminate_backend") @pytest.mark.slow def test_cancel_stream(conn): errors: List[Exception] = [] @@ -236,6 +239,7 @@ def test_identify_closure(dsn): @pytest.mark.skipif( sys.platform == "win32", reason="don't know how to Ctrl-C on Windows" ) +@pytest.mark.crdb("skip", reason="cancel") def test_ctrl_c(dsn): if sys.platform == "win32": sig = int(signal.CTRL_C_EVENT) diff --git a/tests/test_concurrency_async.py b/tests/test_concurrency_async.py index 5008918a2..39f9de86e 100644 --- a/tests/test_concurrency_async.py +++ b/tests/test_concurrency_async.py @@ -61,6 +61,7 @@ async def test_concurrent_execution(dsn): @pytest.mark.slow @pytest.mark.timing +@pytest.mark.crdb("skip", reason="notify") async def test_notifies(aconn, dsn): nconn = await psycopg.AsyncConnection.connect(dsn, autocommit=True) npid = nconn.pgconn.backend_pid @@ -111,6 +112,7 @@ async def canceller(aconn, errors): @pytest.mark.slow +@pytest.mark.crdb("skip", reason="cancel") async def test_cancel(aconn): async def worker(): cur = aconn.cursor() @@ -160,6 +162,7 @@ async def test_cancel_stream(aconn): @pytest.mark.slow +@pytest.mark.crdb("skip", reason="pg_terminate_backend") async def test_identify_closure(dsn): async def closer(): await asyncio.sleep(0.2) @@ -189,6 +192,7 @@ async def test_identify_closure(dsn): @pytest.mark.skipif( sys.platform == "win32", reason="don't know how to Ctrl-C on Windows" ) +@pytest.mark.crdb("skip", reason="cancel") async def test_ctrl_c(dsn): script = f"""\ import signal