]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
test(crdb): enable tests depending on backend_pid on CRDB 22.1
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 8 Jun 2022 00:35:19 +0000 (02:35 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 12 Jul 2022 11:58:34 +0000 (12:58 +0100)
tests/fix_crdb.py
tests/pool/test_null_pool.py
tests/pool/test_null_pool_async.py
tests/pool/test_pool.py
tests/pool/test_pool_async.py

index ad6669dd2dc9a63c886d8242d976a99db6551e93..0098f2b8183e8306cc6ae369a6a5ce4790284158 100644 (file)
@@ -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",
 }
index 4c44d0ce7c0db48026800a06c2247f0606d93a79..385be5519416ee2f4bbab8dacfa6f23bc77d0bde 100644 (file)
@@ -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 = []
index ca449265b6083e50540d601c3281faa91ea7b32b..71e0475f5953eceefc26d57e6626eb663765b57a 100644 (file)
@@ -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 = []
index 373ff5ababc180aa87db043877f7ed7cc8f7294e..31d789d57e4e1b4e4f316537dab86154e68d0caa 100644 (file)
@@ -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")
 
index a541efb189fde00fe7a593d1d86fdbb52cf14814..6ad8a85797b01785e538adb2a2e84ba6d42dc0c4 100644 (file)
@@ -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")