mirror of
https://github.com/status-im/libp2p-test-plans.git
synced 2025-01-13 00:04:17 +00:00
ping/rust: Update rust-sdk patch, remove unused dependencies (#42)
* ping/rust: remove unused dependencies * README: fix import instructions * ping/rust: set channel capacity to # of instances * ping/rust: use testground-v0.4.0 from crates.io
This commit is contained in:
parent
5b5b653430
commit
c71602e88c
@ -20,7 +20,7 @@ When a new version of libp2p is released, we want to make it permanent in the `p
|
|||||||
- update the `go-libp2p` version, go version, and update the code if needed.
|
- update the `go-libp2p` version, go version, and update the code if needed.
|
||||||
- then `go get -tags v$B && go mod tidy`
|
- then `go get -tags v$B && go mod tidy`
|
||||||
3. Run the test on your machine
|
3. Run the test on your machine
|
||||||
- Do once, from the test-plans root: import the test-plans with `testground plan import ./ --name libp2p`
|
- Do once, from the test-plans root: import the test-plans with `testground plan import --from ./ --name libp2p`
|
||||||
- Run the test with `testground run composition -f ping/_compositions/go-cross-versions.toml --wait`
|
- Run the test with `testground run composition -f ping/_compositions/go-cross-versions.toml --wait`
|
||||||
|
|
||||||
## How to add a new version to ping/rust
|
## How to add a new version to ping/rust
|
||||||
|
507
ping/rust/Cargo.lock
generated
507
ping/rust/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -7,13 +7,11 @@ version = "0.1.0"
|
|||||||
async-std = {version = "1.10", features = ["attributes", "tokio1"]}
|
async-std = {version = "1.10", features = ["attributes", "tokio1"]}
|
||||||
env_logger = "0.9.0"
|
env_logger = "0.9.0"
|
||||||
if-addrs = "0.7.0"
|
if-addrs = "0.7.0"
|
||||||
ipnetwork = {version = "0.19.0", default-features = false, features = ["serde"]}
|
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
serde = {version = "1", features = ["derive"]}
|
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
soketto = "0.7.1"
|
soketto = "0.7.1"
|
||||||
testground = {git = "https://github.com/testground/sdk-rust", rev = "94a9a72796f94cc7ca786a5f019d07f328c76d4b", version = "0.4.0"}
|
testground = "0.4.0"
|
||||||
thiserror = "1"
|
thiserror = "1"
|
||||||
tokio = { version = "1", default-features = false, features = ["sync", "rt-multi-thread", "macros", "net"] }
|
tokio = { version = "1", default-features = false, features = ["sync", "rt-multi-thread", "macros", "net"] }
|
||||||
tokio-stream = { version = "0.1", default-features = false, features = [] }
|
tokio-stream = { version = "0.1", default-features = false, features = [] }
|
||||||
|
@ -87,10 +87,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
e => panic!("Unexpected event {:?}", e),
|
e => panic!("Unexpected event {:?}", e),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let test_instance_count = client.run_parameters().test_instance_count as usize;
|
||||||
let mut address_stream = client
|
let mut address_stream = client
|
||||||
.subscribe("peers")
|
.subscribe("peers", test_instance_count)
|
||||||
.await
|
.await
|
||||||
.take(client.run_parameters().test_instance_count as usize)
|
.take(test_instance_count)
|
||||||
.map(|a| {
|
.map(|a| {
|
||||||
let value = a.unwrap();
|
let value = a.unwrap();
|
||||||
let addr = value["Addrs"][0].as_str().unwrap();
|
let addr = value["Addrs"][0].as_str().unwrap();
|
||||||
@ -199,9 +200,9 @@ async fn ping(
|
|||||||
info!("Wait to receive ping from each peer.");
|
info!("Wait to receive ping from each peer.");
|
||||||
let mut pinged = HashSet::new();
|
let mut pinged = HashSet::new();
|
||||||
while pinged.len() < client.run_parameters().test_instance_count as usize - 1 {
|
while pinged.len() < client.run_parameters().test_instance_count as usize - 1 {
|
||||||
if let SwarmEvent::Behaviour(ping::PingEvent {
|
if let SwarmEvent::Behaviour(ping::Event {
|
||||||
peer,
|
peer,
|
||||||
result: Ok(ping::PingSuccess::Ping { .. }),
|
result: Ok(ping::Success::Ping { .. }),
|
||||||
}) = swarm.next().await.unwrap()
|
}) = swarm.next().await.unwrap()
|
||||||
{
|
{
|
||||||
if pinged.insert(peer) {
|
if pinged.insert(peer) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user