From 42360f07333e925a19af6d0eaa58c2bec06c5f2c Mon Sep 17 00:00:00 2001 From: Roland Sherwin Date: Thu, 14 Mar 2024 17:47:53 +0530 Subject: [PATCH 1/2] fix(ci): build packages separately to bypass feature unification process --- .github/workflows/merge.yml | 9 ++++++++- sn_node/Cargo.toml | 3 ++- sn_node_manager/Cargo.toml | 4 +--- sn_service_management/Cargo.toml | 4 +--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index d84864a2ae..84b8b7674e 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -75,8 +75,15 @@ jobs: shell: bash run: if [[ ! $(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].features.default[]? | select(. == "local-discovery")') ]]; then echo "local-discovery is not a default feature in any package."; else echo "local-discovery is a default feature in at least one package." && exit 1; fi + # In a cargo workspace, feature unification can occur, allowing a crate to be built successfully even if it + # doesn't explicitly specify a feature it uses, provided another crate in the workspace enables that feature. + # To detect such cases, we must build each crate using `--package` flag, building all packages at once does not work. - name: Check the whole workspace can build - run: cargo build --all-targets --all-features + shell: bash + run: | + for package in $(cargo metadata --no-deps --format-version=1 | jq -r '.packages[].name'); do + cargo build -p "$package" + done unit: if: "!startsWith(github.event.head_commit.message, 'chore(release):')" diff --git a/sn_node/Cargo.toml b/sn_node/Cargo.toml index ef9e2a6b75..0a8e64ff36 100644 --- a/sn_node/Cargo.toml +++ b/sn_node/Cargo.toml @@ -55,7 +55,7 @@ sn_peers_acquisition= { path="../sn_peers_acquisition", version = "0.2.8" } sn_client = { path = "../sn_client", version = "0.104.29" } sn_logging = { path = "../sn_logging", version = "0.2.23" } sn_networking = { path = "../sn_networking", version = "0.13.33" } -sn_protocol = { path = "../sn_protocol", version = "0.15.4", features = ["rpc"]} +sn_protocol = { path = "../sn_protocol", version = "0.15.4"} sn_registers = { path = "../sn_registers", version = "0.3.10" } sn_transfers = { path = "../sn_transfers", version = "0.16.4" } sn_service_management = { path = "../sn_service_management", version = "0.1.0" } @@ -76,6 +76,7 @@ color-eyre = "0.6.2" assert_matches = "1.5.0" reqwest = { version="0.11.18", default-features=false, features = ["rustls"] } serde_json = "1.0" +sn_protocol = { path = "../sn_protocol", version = "0.15.4", features = ["rpc"]} tempfile = "3.6.0" # Do not specify the version field. Release process expects even the local dev deps to be published. # Removing the version field is a workaround. diff --git a/sn_node_manager/Cargo.toml b/sn_node_manager/Cargo.toml index 0447e0c87a..e75c04065b 100644 --- a/sn_node_manager/Cargo.toml +++ b/sn_node_manager/Cargo.toml @@ -42,9 +42,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" service-manager = "0.6.0" sn_peers_acquisition = { path = "../sn_peers_acquisition", version = "0.2.8" } -sn_protocol = { path = "../sn_protocol", version = "0.15.4", features = [ - "rpc", -]} +sn_protocol = { path = "../sn_protocol", version = "0.15.4" } sn_service_management = { path = "../sn_service_management", version = "0.1.0" } sn-releases = "0.1.7" sn_transfers = { path = "../sn_transfers", version = "0.16.4" } diff --git a/sn_service_management/Cargo.toml b/sn_service_management/Cargo.toml index ff13177498..7f09737d77 100644 --- a/sn_service_management/Cargo.toml +++ b/sn_service_management/Cargo.toml @@ -19,9 +19,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" semver = "1.0.20" service-manager = "0.6.0" -sn_protocol = { path = "../sn_protocol", version = "0.15.4", features = [ - "rpc", -] } +sn_protocol = { path = "../sn_protocol", version = "0.15.4", features = ["rpc"] } sysinfo = "0.29.10" thiserror = "1.0.23" tokio = { version = "1.32.0", features = ["time"] } From fb9191c1d1b431e080890b4049a5e99b19308be1 Mon Sep 17 00:00:00 2001 From: Roland Sherwin Date: Thu, 14 Mar 2024 19:13:53 +0530 Subject: [PATCH 2/2] fix(test): make tweaks to wan nightly tests --- .github/workflows/nightly_wan.yml | 4 ++-- sn_node/tests/common/client.rs | 4 ++-- sn_node/tests/verify_data_location.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nightly_wan.yml b/.github/workflows/nightly_wan.yml index e35f22f29d..b4fa1c0f28 100644 --- a/.github/workflows/nightly_wan.yml +++ b/.github/workflows/nightly_wan.yml @@ -303,13 +303,13 @@ jobs: run: cargo test --release -p sn_node --test sequential_transfers -- --nocapture --test-threads=1 env: SN_LOG: "all" - timeout-minutes: 10 + timeout-minutes: 45 - name: execute the storage payment tests run: cargo test --release -p sn_node --test storage_payments -- --nocapture --test-threads=1 env: SN_LOG: "all" - timeout-minutes: 10 + timeout-minutes: 45 - name: Small wait to allow reward receipt run: sleep 30 diff --git a/sn_node/tests/common/client.rs b/sn_node/tests/common/client.rs index 2bba76cf6e..64744f3fed 100644 --- a/sn_node/tests/common/client.rs +++ b/sn_node/tests/common/client.rs @@ -31,7 +31,7 @@ use super::get_safenode_manager_rpc_client; /// This is a limited hard coded value as Droplet version has to contact the faucet to get the funds. /// This is limited to 10 requests to the faucet, where each request yields 100 SNT -pub const INITIAL_WALLET_BALANCE: u64 = 10 * 100 * 1_000_000_000; +pub const INITIAL_WALLET_BALANCE: u64 = 3 * 100 * 1_000_000_000; /// 100 SNT is added when `add_funds_to_wallet` is called. /// This is limited to 1 request to the faucet, where each request yields 100 SNT @@ -315,7 +315,7 @@ impl Droplet { let _guard = FAUCET_WALLET_MUTEX.lock().await; let requests_to_faucet = if initial_wallet { - let requests_to_faucet = 10; + let requests_to_faucet = 3; assert_eq!( requests_to_faucet * 100 * 1_000_000_000, INITIAL_WALLET_BALANCE diff --git a/sn_node/tests/verify_data_location.rs b/sn_node/tests/verify_data_location.rs index 2393221200..3b2864b605 100644 --- a/sn_node/tests/verify_data_location.rs +++ b/sn_node/tests/verify_data_location.rs @@ -154,8 +154,8 @@ async fn verify_data_location() -> Result<()> { // and get_all_peer_ids is the same as how we do the iteration inside NodeRestart. // todo: make this more cleaner. if all_peers[node_index] == new_peer_id { - error!("new and old peer id are the same {new_peer_id:?}"); println!("new and old peer id are the same {new_peer_id:?}"); + return Err(eyre!("new and old peer id are the same {new_peer_id:?}")); } all_peers[node_index] = new_peer_id; node_index += 1;