Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Add connect integration test #108

Merged
merged 6 commits into from
Mar 22, 2020

Conversation

koivunej
Copy link
Collaborator

@koivunej koivunej commented Mar 22, 2020

The test case hangs for unknown reason.

The test hung initially because a pending NetworkBehaviourAction was placed in the queue to be popped on next poll but the waker was never notified that poll needed to be called again.

Joonas Koivunen added 3 commits March 22, 2020 15:00
this currently fails because the identify query is executed before
network of swarm is ready, or is even polled the first time.
polling swarm first seems important, otherwise there'll be a race to
first listening endpoint getting up at least.
tests/connect_two.rs Outdated Show resolved Hide resolved
Comment on lines +436 to +447
match inner {
SwarmEvent::Behaviour(()) => {}
SwarmEvent::Connected(_peer_id) => {}
SwarmEvent::Disconnected(_peer_id) => {}
SwarmEvent::NewListenAddr(_addr) => {}
SwarmEvent::ExpiredListenAddr(_addr) => {}
SwarmEvent::UnreachableAddr {
peer_id: _peer_id,
address: _address,
error: _error,
} => {}
SwarmEvent::StartConnect(_peer_id) => {}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no harm in keeping this because it's easy to put dbg!(inner) on line 436 here.

@koivunej koivunej marked this pull request as ready for review March 22, 2020 15:07
@koivunej koivunej requested a review from dvc94ch March 22, 2020 15:21
Comment on lines +50 to +58
match ipfs.connect(addr.clone()).await {
Ok(_) => {
connected = Some(addr);
break;
}
Err(e) => {
println!("Failed connecting to {}: {}", addr, e);
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My initial thinking for the connect was that it could be connect(PeerId, Vec<Multiaddr>) as by the looks of libp2p it might dial through all of the addresses. This will probably change somehow in the next version of libp2p because the multiple connections to a peer was merged libp2p/rust-libp2p#1440 and libp2p/rust-libp2p#1493.

@koivunej koivunej merged commit 290fcfa into rs-ipfs:master Mar 22, 2020
@koivunej koivunej deleted the add_connect_integration_test branch September 24, 2020 12:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants