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.
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 }}
@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
@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