Browse Source

tests: fix test_find_path_for_payment. need to close sqlite connection

test was sometimes randomly failing
(always on Windows, as it's illegal to rm open files there)
dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
SomberNight 5 years ago
parent
commit
ec372adbb9
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 1
      electrum/sql_db.py
  2. 5
      electrum/tests/test_lnrouter.py

1
electrum/sql_db.py

@ -54,4 +54,5 @@ class SqlDB(Logger):
self.conn.commit()
# write
self.conn.commit()
self.conn.close()
self.logger.info("SQL thread terminated")

5
electrum/tests/test_lnrouter.py

@ -105,7 +105,10 @@ class Test_LNRouter(TestCaseForTestnet):
self.assertEqual(route[0].node_id, start_node)
self.assertEqual(route[0].short_channel_id, bfh('0000000000000003'))
# need to duplicate tear_down here, as we also need to wait for the sql thread to stop
self.asyncio_loop.call_soon_threadsafe(self._stop_loop.set_result, 1)
self._loop_thread.join(timeout=1)
cdb.sql_thread.join(timeout=1)
def test_new_onion_packet(self):
# test vector from bolt-04

Loading…
Cancel
Save