From 968220e3bae750aa240f8960e7de971f9628de31 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Fri, 2 Dec 2016 15:08:05 +0200 Subject: [PATCH] Increase reconnection delay --- tests/test_connection.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_connection.py b/tests/test_connection.py index f0b009c5..98b94b88 100755 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -304,8 +304,10 @@ 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() @@ -313,6 +315,7 @@ def inner(future, cursor): ret = yield from cur.fetchone() assert (1,) == ret break + delay *= 2 else: assert False, "Cancelled connection transaction status never got idle"