fix(test): only listen on 127.0.0.1 for ephemeral swarm

This resolves an issue where our tests were depending on the number of network interfaces available on the local machine.

Related #4110.

Pull-Request: #4122.


  
Co-Authored-By: Thomas Eizinger <thomas@eizinger.io>
This commit is contained in:
Thomas Eizinger
2023-06-27 03:21:47 +02:00
committed by GitHub
parent e32775d6fb
commit d5475fccde
5 changed files with 32 additions and 6 deletions

View File

@ -418,7 +418,7 @@ mod tests {
let (
[SwarmEvent::OutgoingConnectionError { error: DialError::Denied { cause: outgoing_cause }, .. }],
[_, _, _, SwarmEvent::IncomingConnectionError { error: ListenError::Denied { cause: incoming_cause }, .. }],
[_, SwarmEvent::IncomingConnectionError { error: ListenError::Denied { cause: incoming_cause }, .. }],
) = libp2p_swarm_test::drive(&mut dialer, &mut listener).await else {
panic!("unexpected events")
};