mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Add events in Pubsub
To ensure `handle_peer_queue` and `handle_dead_peer_queue` are indeed run before the tests finish. Previously, we get errors when performing `iter_dag` after cancellation. This is because `handle_peer_queue` or `handle_dead_peer_queue` is not actually run before the Service is cancelled.
This commit is contained in:
@ -245,6 +245,8 @@ class PubsubFactory(factory.Factory):
|
||||
strict_signing=strict_signing,
|
||||
)
|
||||
async with background_trio_service(pubsub):
|
||||
await pubsub.event_handle_peer_queue_started.wait()
|
||||
await pubsub.event_handle_dead_peer_queue_started.wait()
|
||||
yield pubsub
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user