From: Daniele Varrazzo Date: Sun, 5 Jun 2022 20:42:16 +0000 (+0200) Subject: test(crdb): skip tests relying on pg_backend_pid() X-Git-Tag: 3.1~49^2~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3a3e0048cbfef9bf87cdfd725a5bab8680f21a7;p=thirdparty%2Fpsycopg.git test(crdb): skip tests relying on pg_backend_pid() --- diff --git a/tests/pool/test_null_pool.py b/tests/pool/test_null_pool.py index f7fe782cd..69f2a5841 100644 --- a/tests/pool/test_null_pool.py +++ b/tests/pool/test_null_pool.py @@ -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 = [] diff --git a/tests/pool/test_null_pool_async.py b/tests/pool/test_null_pool_async.py index 3e630de52..37f919867 100644 --- a/tests/pool/test_null_pool_async.py +++ b/tests/pool/test_null_pool_async.py @@ -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 = [] diff --git a/tests/pool/test_pool.py b/tests/pool/test_pool.py index 84954fe2f..60c6a04ca 100644 --- a/tests/pool/test_pool.py +++ b/tests/pool/test_pool.py @@ -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: diff --git a/tests/pool/test_pool_async.py b/tests/pool/test_pool_async.py index 3a26a98f0..46f341a87 100644 --- a/tests/pool/test_pool_async.py +++ b/tests/pool/test_pool_async.py @@ -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: