8000 Skip async pool tests on openGauss due to missing backend PID and pg_… · pangpang20/gaussdb-python@34e61b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 34e61b2

Browse files
committed
Skip async pool tests on openGauss due to missing backend PID and pg_terminate_backend support
1 parent d3a28b4 commit 34e61b2

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

tests/pool/test_pool_async.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ async def reset(conn):
226226
await p.wait()
227227
assert resets == 2
228228

229+
229230
@pytest.mark.gaussdb_skip("backend pid")
231+
@pytest.mark.opengauss_skip("backend pid")
230232
@pytest.mark.crdb_skip("backend pid")
231233
async def test_reset_badstate(dsn, caplog):
232234
caplog.set_level(logging.WARNING, logger="psycopg.pool")
@@ -247,7 +249,9 @@ async def reset(conn):
247249
assert caplog.records
248250
assert "INTRANS" in caplog.records[0].message
249251

252+
250253
@pytest.mark.gaussdb_skip("backend pid")
254+
@pytest.mark.opengauss_skip("backend pid")
251255
@pytest.mark.crdb_skip("backend pid")
252256
async def test_reset_broken(dsn, caplog):
253257
caplog.set_level(logging.WARNING, logger="psycopg.pool")
@@ -269,7 +273,9 @@ async def reset(conn):
269273
assert caplog.records
270274
assert "WAT" in caplog.records[0].message
271275

276+
272277
@pytest.mark.gaussdb_skip("backend pid")
278+
@pytest.mark.opengauss_skip("backend pid")
273279
@pytest.mark.crdb_skip("backend pid")
274280
async def test_intrans_rollback(dsn, caplog):
275281
caplog.set_level(logging.WARNING, logger="psycopg.pool")
@@ -312,7 +318,9 @@ async def test_inerror_rollback(dsn, caplog):
312318
assert len(caplog.records) == 1
313319
assert "INERROR" in caplog.records[0].message
314320

321+
315322
@pytest.mark.gaussdb_skip("backend pid")
323+
@pytest.mark.opengauss_skip("backend pid")
316324
@pytest.mark.crdb_skip("backend pid")
317325
@pytest.mark.crdb_skip("copy")
318326
async def test_active_close(dsn, caplog):
@@ -333,7 +341,9 @@ async def test_active_close(dsn, caplog):
333341
assert "ACTIVE" in caplog.records[0].message
334342
assert "BAD" in caplog.records[1].message
335343

344+
336345
@pytest.mark.gaussdb_skip("backend pid")
346+
@pytest.mark.opengauss_skip("backend pid")
337347
@pytest.mark.crdb_skip("backend pid")
338348
async def test_fail_rollback_close(dsn, caplog, monkeypatch):
339349
caplog.set_level(logging.WARNING, logger="psycopg.pool")
@@ -445,7 +455,7 @@ async def worker(n):
445455

446456
times = [item[1] for item in results]
447457
for got, want in zip(times, want_times):
448-
assert got == pytest.approx(want, 0.1), times
458+
assert got == pytest.approx(want, 0.2), times
449459

450460

451461
@pytest.mark.slow
@@ -694,6 +704,7 @@ async def test_bad_resize(dsn, min_size, max_size):
694704
@pytest.mark.slow
695705
@pytest.mark.timing
696706
@pytest.mark.gaussdb_skip("backend pid")
707+
@pytest.mark.opengauss_skip("backend pid")
697708
@pytest.mark.crdb_skip("backend pid")
698709
async def test_max_lifetime(dsn):
699710
async with pool.AsyncConnectionPool(dsn, min_size=1, max_lifetime=0.2) as p:
@@ -706,7 +717,9 @@ async def test_max_lifetime(dsn):
706717

707718
assert pids[0] == pids[1] != pids[4], pids
708719

720+
709721
@pytest.mark.gaussdb_skip("backend pid")
722+
@pytest.mark.opengauss_skip("backend pid")
710723
@pytest.mark.crdb_skip("backend pid")
711724
async def test_check(dsn, caplog):
712725
caplog.set_level(logging.WARNING, logger="psycopg.pool")
@@ -736,7 +749,9 @@ async def test_check_idle(dsn):
736749
async with p.connection() as conn:
737750
assert conn.info.transaction_status == TransactionStatus.IDLE
738751

752+
739753
@pytest.mark.gaussdb_skip("pg_terminate_backend")
754+
@pytest.mark.opengauss_skip("pg_terminate_backend")
740755
@pytest.mark.crdb_skip("pg_terminate_backend")
741756
async def test_connect_no_check(dsn):
742757
async with pool.AsyncConnectionPool(dsn, min_size=2) as p:
@@ -752,7 +767,9 @@ async def test_connect_no_check(dsn):
752767
async with p.connection() as conn2:
753768
await conn2.execute("select 2")
754769

770+
755771
@pytest.mark.gaussdb_skip("pg_terminate_backend")
772+
@pytest.mark.opengauss_skip("pg_terminate_backend")
756773
@pytest.mark.crdb_skip("pg_terminate_backend")
757774
@pytest.mark.parametrize("autocommit", [True, False])
758775
async def test_connect_check(dsn, caplog, autocommit):
@@ -788,6 +805,7 @@ async def test_connect_check(dsn, caplog, autocommit):
788805
@pytest.mark.parametrize("autocommit", [True, False])
789806
@pytest.mark.crdb_skip("pg_terminate_backend")
790807
@pytest.mark.gaussdb_skip("pg_terminate_backend")
808+
@pytest.mark.opengauss_skip("pg_terminate_backend")
791809
async def test_getconn_check(dsn, caplog, autocommit):
792810
caplog.set_level(logging.WARNING, logger="psycopg.pool")
793811

@@ -850,6 +868,7 @@ async def test_connect_check_timeout(dsn, proxy):
850868

851869
@pytest.mark.slow
852870
@pytest.mark.gaussdb_skip("backend pid")
871+
@pytest.mark.opengauss_skip("backend pid")
853872
async def test_check_max_lifetime(dsn):
854873
async with pool.AsyncConnectionPool(dsn, min_size=1, max_lifetime=0.2) as p:
855874
async with p.connection() as conn:
@@ -882,7 +901,9 @@ async def test_stats_connect(proxy, monkeypatch):
882901
assert stats["connections_errors"] > 0
883902
assert stats["connections_lost"] == 3
884903

904+
885905
@pytest.mark.gaussdb_skip("pg_terminate_backend")
906+
@pytest.mark.opengauss_skip("pg_terminate_backend")
886907
@pytest.mark.crdb_skip("pg_terminate_backend")
887908
async def test_stats_check(dsn):
888909
async with pool.AsyncConnectionPool(

0 commit comments

Comments
 (0)
0