We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9371a75 commit 968220eCopy full SHA for 968220e
tests/test_connection.py
@@ -304,15 +304,18 @@ def inner(future, cursor):
304
305
task.cancel()
306
307
+ delay = 0.001
308
+
309
for tick in range(100):
- yield from asyncio.sleep(0, loop=loop)
310
+ yield from asyncio.sleep(delay, loop=loop)
311
status = conn._conn.get_transaction_status()
312
if status == psycopg2.extensions.TRANSACTION_STATUS_IDLE:
313
cur = yield from conn.cursor()
314
yield from cur.execute("SELECT 1")
315
ret = yield from cur.fetchone()
316
assert (1,) == ret
317
break
318
+ delay *= 2
319
else:
320
assert False, "Cancelled connection transaction status never got idle"
321
0 commit comments