(dsn, caplog)
| 226 | |
| 227 | @pytest.mark.crdb_skip("backend pid") |
| 228 | async def test_reset_broken(dsn, caplog): |
| 229 | caplog.set_level(logging.WARNING, logger="psycopg.pool") |
| 230 | |
| 231 | async def reset(conn): |
| 232 | async with conn.transaction(): |
| 233 | await conn.execute("WAT") |
| 234 | |
| 235 | pids = [] |
| 236 | |
| 237 | async def worker(): |
| 238 | async with p.connection() as conn: |
| 239 | await conn.execute("select 1") |
| 240 | pids.append(conn.info.backend_pid) |
| 241 | |
| 242 | async with pool.AsyncNullConnectionPool(dsn, max_size=1, reset=reset) as p: |
| 243 | async with p.connection() as conn: |
| 244 | t = spawn(worker) |
| 245 | await ensure_waiting(p) |
| 246 | |
| 247 | await conn.execute("select 1") |
| 248 | pids.append(conn.info.backend_pid) |
| 249 | |
| 250 | await gather(t) |
| 251 | |
| 252 | assert pids[0] != pids[1] |
| 253 | assert caplog.records |
| 254 | assert "WAT" in caplog.records[0].message |
| 255 | |
| 256 | |
| 257 | @pytest.mark.slow |
nothing calls this directly
no test coverage detected