Skip to content

Commit

Permalink
integration tests for several channel lifetime scenarios
Browse files Browse the repository at this point in the history
* launches several Electrum components to interact on a regtest network
* reloads modules to remove side effects

synchronization of code is still TBD, get rid of asyncio.sleeps
  • Loading branch information
bitromortac committed Feb 10, 2022
1 parent 0df05dd commit 9ef43c7
Show file tree
Hide file tree
Showing 2 changed files with 600 additions and 0 deletions.
2 changes: 2 additions & 0 deletions electrum/lnworker.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ def start_network(self, network: 'Network'):
async def stop(self):
if self.listen_server:
self.listen_server.close()
await self.listen_server.wait_closed()
util.unregister_callback(self.on_proxy_changed)
await self.taskgroup.cancel_remaining()

Expand Down Expand Up @@ -755,6 +756,7 @@ async def stop(self):
self.stopping_soon = True
if self.listen_server: # stop accepting new peers
self.listen_server.close()
await self.listen_server.wait_closed()
async with ignore_after(self.TIMEOUT_SHUTDOWN_FAIL_PENDING_HTLCS):
await self.wait_for_received_pending_htlcs_to_get_removed()
await LNWorker.stop(self)
Expand Down

0 comments on commit 9ef43c7

Please sign in to comment.