forked from LBRYCommunity/lbry-sdk
fix reconnect test
This commit is contained in:
parent
ac7e94c6ed
commit
2313d30996
3 changed files with 3 additions and 3 deletions
|
@ -348,7 +348,6 @@ class Network:
|
||||||
await self._keepalive_task
|
await self._keepalive_task
|
||||||
if self._urgent_need_reconnect.is_set():
|
if self._urgent_need_reconnect.is_set():
|
||||||
log.warning("urgent reconnect needed")
|
log.warning("urgent reconnect needed")
|
||||||
self._urgent_need_reconnect.clear()
|
|
||||||
if self._keepalive_task and not self._keepalive_task.done():
|
if self._keepalive_task and not self._keepalive_task.done():
|
||||||
self._keepalive_task.cancel()
|
self._keepalive_task.cancel()
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -69,7 +69,7 @@ setup(
|
||||||
'jsonschema==4.4.0',
|
'jsonschema==4.4.0',
|
||||||
],
|
],
|
||||||
'hub': [
|
'hub': [
|
||||||
'hub@git+https://github.com/lbryio/hub.git@0901f67d89a17b403dd43aed939dd3f056af3d58'
|
'hub@git+https://github.com/lbryio/hub.git@76dd9c392b776a2823015762814f375794120076'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
classifiers=[
|
classifiers=[
|
||||||
|
|
|
@ -116,7 +116,7 @@ class ReconnectTests(IntegrationTestCase):
|
||||||
# disconnect and send a new tx, should reconnect and get it
|
# disconnect and send a new tx, should reconnect and get it
|
||||||
self.ledger.network.client.transport.close()
|
self.ledger.network.client.transport.close()
|
||||||
self.assertFalse(self.ledger.network.is_connected)
|
self.assertFalse(self.ledger.network.is_connected)
|
||||||
await self.ledger.resolve([], 'derp')
|
await self.ledger.resolve([], ['derp'])
|
||||||
sendtxid = await self.send_to_address_and_wait(address1, 1.1337, 1)
|
sendtxid = await self.send_to_address_and_wait(address1, 1.1337, 1)
|
||||||
self.assertLess(self.ledger.network.client.response_time, 1) # response time properly set lower, we are fine
|
self.assertLess(self.ledger.network.client.response_time, 1) # response time properly set lower, we are fine
|
||||||
|
|
||||||
|
@ -139,6 +139,7 @@ class ReconnectTests(IntegrationTestCase):
|
||||||
if not self.ledger.network.is_connected:
|
if not self.ledger.network.is_connected:
|
||||||
await asyncio.wait_for(self.ledger.network.on_connected.first, timeout=10.0)
|
await asyncio.wait_for(self.ledger.network.on_connected.first, timeout=10.0)
|
||||||
# omg, the burned cable still works! torba is fire proof!
|
# omg, the burned cable still works! torba is fire proof!
|
||||||
|
await self.ledger.on_header.where(self.blockchain.is_expected_block)
|
||||||
await self.ledger.network.get_transaction(sendtxid)
|
await self.ledger.network.get_transaction(sendtxid)
|
||||||
|
|
||||||
async def test_timeout_then_reconnect(self):
|
async def test_timeout_then_reconnect(self):
|
||||||
|
|
Loading…
Reference in a new issue