add test to verify we listen to on_ready before it actually triggers

This commit is contained in:
Lex Berezhny 2020-03-30 15:26:04 -04:00
parent 85551d1e54
commit ed38966edb

View file

@ -1,4 +1,3 @@
import logging
import asyncio import asyncio
import lbry import lbry
@ -61,7 +60,14 @@ class NetworkTests(IntegrationTestCase):
}, await self.ledger.network.get_server_features()) }, await self.ledger.network.get_server_features())
class ReconnectTests(IntegrationTestCase): class NetworkConnectionTests(IntegrationTestCase):
async def test_on_ready_listening_before_event_fix_2896(self):
await self.ledger.stop()
# slow down other parts to make network finish first and fire on_ready
self.account.maybe_migrate_certificates = lambda: asyncio.sleep(2)
await asyncio.wait_for(self.ledger.start(), timeout=3)
# above ledger.start() will fail if on_ready fired before listening
async def test_multiple_servers(self): async def test_multiple_servers(self):
# we have a secondary node that connects later, so # we have a secondary node that connects later, so