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)
This commit is contained in:
SomberNight 2019-09-22 21:21:24 +02:00
parent 04edad9984
commit ec372adbb9
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9
2 changed files with 5 additions and 1 deletions

View file

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

View file

@ -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