mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-04-08 23:11:27 +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:
@ -106,6 +106,7 @@ async def test_handle_graft(monkeypatch):
|
||||
|
||||
async def emit_prune(topic, sender_peer_id):
|
||||
event_emit_prune.set()
|
||||
await trio.hazmat.checkpoint()
|
||||
|
||||
monkeypatch.setattr(gossipsubs[index_bob], "emit_prune", emit_prune)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user