From: Rafi Shamim Date: Mon, 12 Dec 2022 21:47:33 +0000 (-0500) Subject: Run tests against CockroachDB v22.2 X-Git-Tag: pool-3.1.5~7^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5db90ec9aa06d9751f9395dea70a2385bb18559;p=thirdparty%2Fpsycopg.git Run tests against CockroachDB v22.2 v22.2 was released recently, so we can test it. This upgrade revealed a regression in CRDB that we must workaround (https://github.com/cockroachdb/cockroach/issues/93739). This also removes testing for v21.2, since it is no longer supported. --- diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0fdd99be2..160a71b08 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -265,8 +265,8 @@ jobs: fail-fast: false matrix: include: + - {crdb: "latest-v22.2", python: "3.10", impl: "c", libpq: "newest"} - {crdb: "latest-v22.1", python: "3.10", impl: "c", libpq: "newest"} - - {crdb: "latest-v21.2", python: "3.9", impl: "python", libpq: ""} env: PSYCOPG_IMPL: ${{ matrix.impl }} diff --git a/tests/crdb/test_connection.py b/tests/crdb/test_connection.py index e3d4b4673..b2a69ef53 100644 --- a/tests/crdb/test_connection.py +++ b/tests/crdb/test_connection.py @@ -44,8 +44,9 @@ def test_tpc_recover(dsn): @pytest.mark.slow def test_broken_connection(conn): cur = conn.cursor() + (session_id,) = cur.execute("select session_id from [show session_id]").fetchone() with pytest.raises(psycopg.DatabaseError): - cur.execute("cancel session (select session_id from [show session_id])") + cur.execute("cancel session %s", [session_id]) assert conn.closed diff --git a/tests/crdb/test_connection_async.py b/tests/crdb/test_connection_async.py index 6fb8fdfe8..b568e426e 100644 --- a/tests/crdb/test_connection_async.py +++ b/tests/crdb/test_connection_async.py @@ -42,8 +42,10 @@ async def test_tpc_recover(dsn): @pytest.mark.slow async def test_broken_connection(aconn): cur = aconn.cursor() + await cur.execute("select session_id from [show session_id]") + (session_id,) = await cur.fetchone() with pytest.raises(psycopg.DatabaseError): - await cur.execute("cancel session (select session_id from [show session_id])") + await cur.execute("cancel session %s", [session_id]) assert aconn.closed