]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
test(crdb): skip tests relying on pg_backend_pid()
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 5 Jun 2022 20:42:16 +0000 (22:42 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 12 Jul 2022 11:58:34 +0000 (12:58 +0100)
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 f7fe782cd8a4f461fea3f07e64a2e0a23187a43b..69f2a584150c62876486913623e5545adedc7b1f 100644 (file)
@@ -54,6 +54,7 @@ def test_kwargs(dsn):
             assert conn.autocommit
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_its_no_pool_at_all(dsn):
     with NullConnectionPool(dsn, max_size=2) as p:
         with p.connection() as conn:
@@ -167,6 +168,7 @@ def test_configure_broken(dsn, caplog):
     assert "WAT" in caplog.records[0].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_reset(dsn):
     resets = 0
 
@@ -209,6 +211,7 @@ def test_reset(dsn):
     assert pids[0] == pids[1]
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_reset_badstate(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -239,6 +242,7 @@ def test_reset_badstate(dsn, caplog):
     assert "INTRANS" in caplog.records[0].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_reset_broken(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -439,6 +443,7 @@ def test_queue_timeout_override(dsn):
         assert 0.1 < e[1] < 0.15
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_broken_reconnect(dsn):
     with NullConnectionPool(dsn, max_size=1) as p:
         with p.connection() as conn:
@@ -453,6 +458,7 @@ def test_broken_reconnect(dsn):
     assert pid1 != pid2
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_intrans_rollback(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
     pids = []
@@ -485,6 +491,7 @@ def test_intrans_rollback(dsn, caplog):
     assert "INTRANS" in caplog.records[0].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_inerror_rollback(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
     pids = []
@@ -515,6 +522,7 @@ def test_inerror_rollback(dsn, caplog):
     assert "INERROR" in caplog.records[0].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_active_close(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
     pids = []
@@ -543,6 +551,7 @@ def test_active_close(dsn, caplog):
     assert "BAD" in caplog.records[1].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_fail_rollback_close(dsn, caplog, monkeypatch):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
     pids = []
index 3e630de52ff69a5d6ddea4a50e2e5bc2d06d9609..37f919867de99713a92991420beb4df13a5d22ae 100644 (file)
@@ -56,6 +56,7 @@ async def test_kwargs(dsn):
             assert conn.autocommit
 
 
+@pytest.mark.crdb("skip", reason="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:
@@ -169,6 +170,7 @@ async def test_configure_broken(dsn, caplog):
     assert "WAT" in caplog.records[0].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_reset(dsn):
     resets = 0
 
@@ -210,6 +212,7 @@ async def test_reset(dsn):
     assert pids[0] == pids[1]
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_reset_badstate(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -239,6 +242,7 @@ async def test_reset_badstate(dsn, caplog):
     assert "INTRANS" in caplog.records[0].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_reset_broken(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -421,6 +425,7 @@ async def test_queue_timeout_override(dsn):
         assert 0.1 < e[1] < 0.15
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_broken_reconnect(dsn):
     async with AsyncNullConnectionPool(dsn, max_size=1) as p:
         async with p.connection() as conn:
@@ -435,6 +440,7 @@ async def test_broken_reconnect(dsn):
     assert pid1 != pid2
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_intrans_rollback(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
     pids = []
@@ -467,6 +473,7 @@ async def test_intrans_rollback(dsn, caplog):
     assert "INTRANS" in caplog.records[0].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_inerror_rollback(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
     pids = []
@@ -494,6 +501,7 @@ async def test_inerror_rollback(dsn, caplog):
     assert "INERROR" in caplog.records[0].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_active_close(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
     pids = []
@@ -521,6 +529,7 @@ async def test_active_close(dsn, caplog):
     assert "BAD" in caplog.records[1].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_fail_rollback_close(dsn, caplog, monkeypatch):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
     pids = []
index 84954fe2fef28833f54948b11f7be0dfc9604f7f..60c6a04caa08d1475926f2b08d244d51d81e774b 100644 (file)
@@ -64,6 +64,7 @@ def test_kwargs(dsn):
             assert conn.autocommit
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_its_really_a_pool(dsn):
     with pool.ConnectionPool(dsn, min_size=2) as p:
         with p.connection() as conn:
@@ -84,6 +85,7 @@ def test_context(dsn):
     assert p.closed
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_connection_not_lost(dsn):
     with pool.ConnectionPool(dsn, min_size=1) as p:
         with pytest.raises(ZeroDivisionError):
@@ -245,6 +247,7 @@ def test_reset(dsn):
         assert resets == 2
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_reset_badstate(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -265,6 +268,7 @@ def test_reset_badstate(dsn, caplog):
     assert "INTRANS" in caplog.records[0].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_reset_broken(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -447,6 +451,7 @@ def test_queue_timeout_override(dsn):
         assert 0.1 < e[1] < 0.15
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_broken_reconnect(dsn):
     with pool.ConnectionPool(dsn, min_size=1) as p:
         with p.connection() as conn:
@@ -461,6 +466,7 @@ def test_broken_reconnect(dsn):
     assert pid1 != pid2
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_intrans_rollback(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -482,6 +488,7 @@ def test_intrans_rollback(dsn, caplog):
     assert "INTRANS" in caplog.records[0].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_inerror_rollback(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -501,6 +508,7 @@ def test_inerror_rollback(dsn, caplog):
     assert "INERROR" in caplog.records[0].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_active_close(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -520,6 +528,7 @@ def test_active_close(dsn, caplog):
     assert "BAD" in caplog.records[1].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_fail_rollback_close(dsn, caplog, monkeypatch):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -996,6 +1005,7 @@ def test_max_lifetime(dsn):
     assert pids[0] == pids[1] != pids[4], pids
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 def test_check(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
     with pool.ConnectionPool(dsn, min_size=4) as p:
index 3a26a98f032e9a354fdda2be595bfb71f4ef4091..46f341a87759225d5a3f27c91e53b53b2564b7c9 100644 (file)
@@ -57,6 +57,7 @@ async def test_kwargs(dsn):
             assert conn.autocommit
 
 
+@pytest.mark.crdb("skip", reason="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:
@@ -77,6 +78,7 @@ async def test_context(dsn):
     assert p.closed
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_connection_not_lost(dsn):
     async with pool.AsyncConnectionPool(dsn, min_size=1) as p:
         with pytest.raises(ZeroDivisionError):
@@ -242,6 +244,7 @@ async def test_reset(dsn):
         assert resets == 2
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_reset_badstate(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -262,6 +265,7 @@ async def test_reset_badstate(dsn, caplog):
     assert "INTRANS" in caplog.records[0].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_reset_broken(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -425,6 +429,7 @@ async def test_queue_timeout_override(dsn):
         assert 0.1 < e[1] < 0.15
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_broken_reconnect(dsn):
     async with pool.AsyncConnectionPool(dsn, min_size=1) as p:
         async with p.connection() as conn:
@@ -439,6 +444,7 @@ async def test_broken_reconnect(dsn):
     assert pid1 != pid2
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_intrans_rollback(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -461,6 +467,7 @@ async def test_intrans_rollback(dsn, caplog):
     assert "INTRANS" in caplog.records[0].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_inerror_rollback(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -480,6 +487,7 @@ async def test_inerror_rollback(dsn, caplog):
     assert "INERROR" in caplog.records[0].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_active_close(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -499,6 +507,7 @@ async def test_active_close(dsn, caplog):
     assert "BAD" in caplog.records[1].message
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_fail_rollback_close(dsn, caplog, monkeypatch):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
 
@@ -944,6 +953,7 @@ async def test_max_lifetime(dsn):
     assert pids[0] == pids[1] != pids[4], pids
 
 
+@pytest.mark.crdb("skip", reason="backend pid")
 async def test_check(dsn, caplog):
     caplog.set_level(logging.WARNING, logger="psycopg.pool")
     async with pool.AsyncConnectionPool(dsn, min_size=4) as p: