mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
test: close the loop after the network thread has completed
https://docs.python.org/3.15/library/asyncio-eventloop.html#asyncio.loop.close reads "The loop must not be running when this function is called". It seems safer to call `close()` after the thread has exited.
This commit is contained in:
@@ -774,8 +774,8 @@ class NetworkThread(threading.Thread):
|
||||
|
||||
self.network_event_loop.call_soon_threadsafe(self.network_event_loop.stop)
|
||||
wait_until_helper_internal(lambda: not self.network_event_loop.is_running(), timeout=timeout)
|
||||
self.network_event_loop.close()
|
||||
self.join(timeout)
|
||||
self.network_event_loop.close()
|
||||
# Safe to remove event loop.
|
||||
NetworkThread.network_event_loop = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user