Skip to content

Commit f2a9734

Browse files
sanityiduartgomez
authored andcommitted
test: add freenet-test-network integration harness (#2066)
1 parent 9e558db commit f2a9734

File tree

11 files changed

+365
-29
lines changed

11 files changed

+365
-29
lines changed

Cargo.lock

Lines changed: 142 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/freenet-ping/Cargo.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/freenet-ping/app/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ edition = "2021"
55

66
[features]
77
testing = ["freenet-stdlib/testing", "freenet/testing"]
8+
manual-tests = []
89

910
[dependencies]
1011
anyhow = "1.0"

apps/freenet-ping/app/src/ping_client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub async fn wait_for_put_response(
4747
expected_key: &ContractKey,
4848
) -> Result<ContractKey, Box<dyn std::error::Error + Send + Sync + 'static>> {
4949
loop {
50-
let resp = timeout(Duration::from_secs(30), client.recv()).await;
50+
let resp = timeout(Duration::from_secs(60), client.recv()).await;
5151
match resp {
5252
Ok(Ok(HostResponse::ContractResponse(ContractResponse::PutResponse { key }))) => {
5353
if &key == expected_key {
@@ -91,7 +91,7 @@ pub async fn wait_for_get_response(
9191
expected_key: &ContractKey,
9292
) -> Result<Ping, Box<dyn std::error::Error + Send + Sync + 'static>> {
9393
loop {
94-
let resp = timeout(Duration::from_secs(30), client.recv()).await;
94+
let resp = timeout(Duration::from_secs(60), client.recv()).await;
9595
match resp {
9696
Ok(Ok(HostResponse::ContractResponse(ContractResponse::GetResponse {
9797
key,
@@ -134,7 +134,7 @@ pub async fn wait_for_subscribe_response(
134134
expected_key: &ContractKey,
135135
) -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
136136
loop {
137-
let resp = timeout(Duration::from_secs(30), client.recv()).await;
137+
let resp = timeout(Duration::from_secs(60), client.recv()).await;
138138
match resp {
139139
Ok(Ok(HostResponse::ContractResponse(ContractResponse::SubscribeResponse {
140140
key,

apps/freenet-ping/app/tests/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ Run a specific blocked peers test variant:
8888
cargo test test_ping_blocked_peers_simple
8989
```
9090

91-
Run the large-scale partial connectivity network test:
91+
Run the large-scale partial connectivity network test (requires the manual test feature because the scenario is still experimental):
9292

9393
```bash
94-
cargo test -p freenet-ping-app --test run_app_partially_connected_network
94+
cargo test -p freenet-ping-app --features manual-tests --test run_app test_ping_partially_connected_network
9595
```
9696

9797
---

0 commit comments

Comments
 (0)