Skip to content

Commit

Permalink
Increase reconnection delay
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Dec 2, 2016
1 parent 9371a75 commit 968220e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,18 @@ def inner(future, cursor):

task.cancel()

delay = 0.001

for tick in range(100):
yield from asyncio.sleep(0, loop=loop)
yield from asyncio.sleep(delay, loop=loop)
status = conn._conn.get_transaction_status()
if status == psycopg2.extensions.TRANSACTION_STATUS_IDLE:
cur = yield from conn.cursor()
yield from cur.execute("SELECT 1")
ret = yield from cur.fetchone()
assert (1,) == ret
break
delay *= 2
else:
assert False, "Cancelled connection transaction status never got idle"

Expand Down

0 comments on commit 968220e

Please sign in to comment.