fix(kad): allow for different order of events in assertion

Fixes the test failure witnessed in https://github.com/libp2p/rust-libp2p/actions/runs/5392115337/jobs/9790198947?pr=4128#step:6:162.

Pull-Request: #4129.
This commit is contained in:
Thomas Eizinger
2023-06-28 13:26:44 +01:00
committed by GitHub
parent 7de8f0b66a
commit f335697573

View File

@@ -61,6 +61,10 @@ async fn two_servers_add_each_other_to_routing_table() {
(
[Identify(_), Kad(UnroutablePeer { .. }), Identify(_), Kad(RoutingUpdated { peer: peer2, .. }), Identify(_)],
[Identify(_), Identify(_)],
)
| (
[Identify(_), Kad(UnroutablePeer { .. }), Identify(_), Identify(_), Kad(RoutingUpdated { peer: peer2, .. })],
[Identify(_), Identify(_)],
) => {
assert_eq!(peer2, server1_peer_id);
}