Files
bitcoin/test/functional/test_framework
Vasil Dimov 29fba5ddbb test: close the listeners before terminating the event loop
Whenever a test creates a new `P2PInterface` object a new listener is
created inside `NetworkThread.create_listen_server()` by calling
`cls.network_event_loop.create_server()`.

These listeners are never closed which might result in:

```
2026-06-10T22:13:35.3934880Z Task was destroyed but it is pending!
2026-06-10T22:13:35.3936020Z task: <Task pending name='Task-54' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /opt/homebrew/Cellar/python@3.14/3.14.5/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/selector_events.py:217> wait_for=<Future finished result=None>>
```

when the event loop is closed.

Fix that by closing the listeners.

Fixes: https://github.com/bitcoin/bitcoin/issues/35508
2026-08-18 06:17:23 +02:00
..
2026-07-17 20:09:58 -07:00