Skip to content

Commit 968220e

Browse files
committed
Increase reconnection delay
1 parent 9371a75 commit 968220e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_connection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,15 +304,18 @@ def inner(future, cursor):
304304

305305
task.cancel()
306306

307+
delay = 0.001
308+
307309
for tick in range(100):
308-
yield from asyncio.sleep(0, loop=loop)
310+
yield from asyncio.sleep(delay, loop=loop)
309311
status = conn._conn.get_transaction_status()
310312
if status == psycopg2.extensions.TRANSACTION_STATUS_IDLE:
311313
cur = yield from conn.cursor()
312314
yield from cur.execute("SELECT 1")
313315
ret = yield from cur.fetchone()
314316
assert (1,) == ret
315317
break
318+
delay *= 2
316319
else:
317320
assert False, "Cancelled connection transaction status never got idle"
318321

0 commit comments

Comments
 (0)