libp2p / go-libp2p-kad-dht

A Kademlia DHT implementation on go-libp2p
https://github.com/libp2p/specs/tree/master/kad-dht
MIT License
524 stars 224 forks source link

Fix test flakes that wait for routing events #905

Closed iand closed 1 year ago

iand commented 1 year ago

Replaces the routing notification channel with a type that is passed in by the consumer. This allows tests waiting for routing notifications to deterministically buffer and inspect the entire set of notifications.

Tests in DHT package are a little more awkward to write since they have to pass in a RoutingNotifier but we need to do a pass over the test helpers anyway and should clean all of it up with some helper functions.