mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-28 18:21:20 +00:00
The test `max_established_incoming` starts two networks with a configured connection limit, spawns up to `limit + 1` connections and expects the last connection to be closed due to being over the limit. The previous test implementation depended on both networks to handle each connection in sequence, which is not always the case. E.g. while network 2 might expect the last connection to close, network 1 might finish upgrading the last connection before the second to last connection, thus expecting the second to last connection to close. This commit drives network 1 and 2 in sequence and ensures both networks are finished upgrading a connection before starting a new connection. In addition it upgrade the test to use `quickcheck`.