From: Daniele Varrazzo Date: Wed, 8 Jun 2022 00:35:19 +0000 (+0200) Subject: test(crdb): enable tests depending on backend_pid on CRDB 22.1 X-Git-Tag: 3.1~49^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b75183e9ac6159cd4c25b59afbb005cbcc8fcc1f;p=thirdparty%2Fpsycopg.git test(crdb): enable tests depending on backend_pid on CRDB 22.1 --- diff --git a/tests/fix_crdb.py b/tests/fix_crdb.py index ad6669dd2..0098f2b81 100644 --- a/tests/fix_crdb.py +++ b/tests/fix_crdb.py @@ -112,14 +112,16 @@ _crdb_reasons = { "no col query": None, "notify": 41522, "password_encryption": 42519, + "pg_backend_pid": 35897, "pg_terminate_backend": 35897, "range": 41282, - "severity_nonlocalized": 81794, "scroll cursor": 77102, "server-side cursor": 41412, + "severity_nonlocalized": 81794, "stored procedure": 1751, } _crdb_reason_version = { + "backend pid": "skip < 22", "cancel": "skip < 22", } diff --git a/tests/pool/test_null_pool.py b/tests/pool/test_null_pool.py index 4c44d0ce7..385be5519 100644 --- a/tests/pool/test_null_pool.py +++ b/tests/pool/test_null_pool.py @@ -54,7 +54,7 @@ def test_kwargs(dsn): assert conn.autocommit -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") def test_its_no_pool_at_all(dsn): with NullConnectionPool(dsn, max_size=2) as p: with p.connection() as conn: @@ -285,7 +285,7 @@ def test_no_queue_timeout(deaf_port): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") def test_queue(dsn): def worker(n): t0 = time() @@ -352,7 +352,7 @@ def test_queue_size(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") def test_queue_timeout(dsn): def worker(n): t0 = time() @@ -413,7 +413,7 @@ def test_dead_client(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") def test_queue_timeout_override(dsn): def worker(n): t0 = time() @@ -446,7 +446,7 @@ def test_queue_timeout_override(dsn): assert 0.1 < e[1] < 0.15 -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") def test_broken_reconnect(dsn): with NullConnectionPool(dsn, max_size=1) as p: with p.connection() as conn: @@ -526,6 +526,7 @@ def test_inerror_rollback(dsn, caplog): @pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("copy") def test_active_close(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") pids = [] diff --git a/tests/pool/test_null_pool_async.py b/tests/pool/test_null_pool_async.py index ca449265b..71e0475f5 100644 --- a/tests/pool/test_null_pool_async.py +++ b/tests/pool/test_null_pool_async.py @@ -56,7 +56,7 @@ async def test_kwargs(dsn): assert conn.autocommit -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") async def test_its_no_pool_at_all(dsn): async with AsyncNullConnectionPool(dsn, max_size=2) as p: async with p.connection() as conn: @@ -286,7 +286,7 @@ async def test_no_queue_timeout(deaf_port): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") async def test_queue(dsn): async def worker(n): t0 = time() @@ -345,7 +345,7 @@ async def test_queue_size(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") async def test_queue_timeout(dsn): async def worker(n): t0 = time() @@ -399,7 +399,7 @@ async def test_dead_client(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") async def test_queue_timeout_override(dsn): async def worker(n): t0 = time() @@ -428,7 +428,7 @@ async def test_queue_timeout_override(dsn): assert 0.1 < e[1] < 0.15 -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") async def test_broken_reconnect(dsn): async with AsyncNullConnectionPool(dsn, max_size=1) as p: async with p.connection() as conn: @@ -505,6 +505,7 @@ async def test_inerror_rollback(dsn, caplog): @pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("copy") async def test_active_close(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") pids = [] diff --git a/tests/pool/test_pool.py b/tests/pool/test_pool.py index 373ff5aba..31d789d57 100644 --- a/tests/pool/test_pool.py +++ b/tests/pool/test_pool.py @@ -64,7 +64,7 @@ def test_kwargs(dsn): assert conn.autocommit -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") def test_its_really_a_pool(dsn): with pool.ConnectionPool(dsn, min_size=2) as p: with p.connection() as conn: @@ -292,7 +292,7 @@ def test_reset_broken(dsn, caplog): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") def test_queue(dsn): def worker(n): t0 = time() @@ -359,7 +359,7 @@ def test_queue_size(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") def test_queue_timeout(dsn): def worker(n): t0 = time() @@ -421,7 +421,7 @@ def test_dead_client(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") def test_queue_timeout_override(dsn): def worker(n): t0 = time() @@ -454,7 +454,7 @@ def test_queue_timeout_override(dsn): assert 0.1 < e[1] < 0.15 -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") def test_broken_reconnect(dsn): with pool.ConnectionPool(dsn, min_size=1) as p: with p.connection() as conn: @@ -512,6 +512,7 @@ def test_inerror_rollback(dsn, caplog): @pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("copy") def test_active_close(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") diff --git a/tests/pool/test_pool_async.py b/tests/pool/test_pool_async.py index a541efb18..6ad8a8579 100644 --- a/tests/pool/test_pool_async.py +++ b/tests/pool/test_pool_async.py @@ -57,7 +57,7 @@ async def test_kwargs(dsn): assert conn.autocommit -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") async def test_its_really_a_pool(dsn): async with pool.AsyncConnectionPool(dsn, min_size=2) as p: async with p.connection() as conn: @@ -289,7 +289,7 @@ async def test_reset_broken(dsn, caplog): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") async def test_queue(dsn): async def worker(n): t0 = time() @@ -348,7 +348,7 @@ async def test_queue_size(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") async def test_queue_timeout(dsn): async def worker(n): t0 = time() @@ -403,7 +403,7 @@ async def test_dead_client(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") async def test_queue_timeout_override(dsn): async def worker(n): t0 = time() @@ -432,7 +432,7 @@ async def test_queue_timeout_override(dsn): assert 0.1 < e[1] < 0.15 -@pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("pg_backend_pid") async def test_broken_reconnect(dsn): async with pool.AsyncConnectionPool(dsn, min_size=1) as p: async with p.connection() as conn: @@ -491,6 +491,7 @@ async def test_inerror_rollback(dsn, caplog): @pytest.mark.crdb_skip("backend pid") +@pytest.mark.crdb_skip("copy") async def test_active_close(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool")