Skip to content

Commit

Permalink
test(IDX): allow more time for //rs/nervous_system/integration_tests:…
Browse files Browse the repository at this point in the history
…... (#3059)

Since the `//rs/nervous_system/integration_tests:...` tests often time
out we increase their timeout from 5 to 15 minutes. If it turns out
their P90 duration will go over 5 minutes we'll tag them as `long_test`
to no longer run them on PRs but only on pushes to master.

Additionally since
`//rs/nervous_system/integration_tests:integration_tests_test_tests/sns_ledger_upgrade`
[ran into a
timeout](https://dash.zh1-idx1.dfinity.network/invocation/eda26713-6f08-4f88-94c8-cacebd92ad50?target=%2F%2Frs%2Fnervous_system%2Fintegration_tests%3Aintegration_tests_test_tests%2Fsns_ledger_upgrade&targetStatus=11)
we isolate it into its own bazel target `deploy_fresh_sns_test` and add
more logs.
  • Loading branch information
basvandijk authored Dec 9, 2024
1 parent 00eb69d commit 90f4535
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
22 changes: 22 additions & 0 deletions rs/nervous_system/integration_tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ rust_library(

rust_test_suite_with_extra_srcs(
name = "integration_tests_test",
timeout = "long",
srcs = glob(
["tests/**/*.rs"],
exclude = [
Expand All @@ -174,6 +175,7 @@ rust_test_suite_with_extra_srcs(
"tests/upgrade_everything_test.rs",
"tests/advance_target_version_upgrades_all_canisters_test.rs",
"tests/upgrade_existing_sns_test.rs",
"tests/deploy_fresh_sns_test.rs",
],
),
aliases = ALIASES,
Expand All @@ -190,6 +192,7 @@ rust_test_suite_with_extra_srcs(

rust_test(
name = "upgrade_everything_test",
timeout = "long",
srcs = [
"tests/sns_upgrade_test_utils.rs",
"tests/upgrade_everything_test.rs",
Expand All @@ -208,6 +211,7 @@ rust_test(

rust_test(
name = "advance_target_version_upgrades_all_canisters_test",
timeout = "long",
srcs = [
"tests/advance_target_version_upgrades_all_canisters_test.rs",
],
Expand All @@ -224,6 +228,7 @@ rust_test(

rust_test(
name = "upgrade_existing_sns_test",
timeout = "long",
srcs = [
"tests/upgrade_existing_sns_test.rs",
],
Expand All @@ -237,3 +242,20 @@ rust_test(
],
deps = [":nervous_system_integration_tests"] + DEPENDENCIES_WITH_TEST_FEATURES + DEV_DEPENDENCIES,
)

rust_test(
name = "deploy_fresh_sns_test",
timeout = "long",
srcs = [
"tests/deploy_fresh_sns_test.rs",
],
aliases = ALIASES,
data = DEV_DATA,
env = DEV_ENV | {"RUST_TEST_NOCAPTURE": "1"},
flaky = True,
proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES,
tags = [
"cpu:4",
],
deps = [":nervous_system_integration_tests"] + DEPENDENCIES_WITH_TEST_FEATURES + DEV_DEPENDENCIES,
)
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ async fn test_deploy_fresh_sns() {
.map(|canister| CanisterId::unchecked_from_principal(canister.id.unwrap()))
.collect();

// 1. Prepare the world (use mainnet WASMs for all NNS and SNS canisters).
eprintln!("1. Prepare the world (use mainnet WASMs for all NNS and SNS canisters) ...");
let pocket_ic = pocket_ic_helpers::pocket_ic_for_sns_tests_with_mainnet_versions().await;

// Install the test dapp.
eprintln!("Install the test dapp ...");
for dapp_canister_id in dapp_canister_ids.clone() {
install_canister(
&pocket_ic,
Expand All @@ -49,13 +49,12 @@ async fn test_deploy_fresh_sns() {
.await;
}

// Step 1. Upgrade NNS Governance and SNS-W to the latest version.

eprintln!("Step 1. Upgrade NNS Governance and SNS-W to the latest version ...");
upgrade_nns_canister_to_tip_of_master_or_panic(&pocket_ic, GOVERNANCE_CANISTER_ID).await;

upgrade_nns_canister_to_tip_of_master_or_panic(&pocket_ic, SNS_WASM_CANISTER_ID).await;

// Test upgrading SNS Ledger via proposals. First, add all the WASMs to SNS-W.
eprintln!("Test upgrading SNS Ledger via proposals. First, add all the WASMs to SNS-W ...");
{
let wasm = build_index_ng_sns_wasm();
let proposal_info = add_wasm_via_nns_proposal(&pocket_ic, wasm).await.unwrap();
Expand All @@ -76,7 +75,7 @@ async fn test_deploy_fresh_sns() {
// --- Run code under test ---
// ---------------------------

// Deploy an SNS instance via proposal.
eprintln!("Deploy an SNS instance via proposal ...");
let sns_instance_label = "1";
let (sns, _) = nns::governance::propose_to_deploy_sns_and_wait(
&pocket_ic,
Expand All @@ -85,7 +84,7 @@ async fn test_deploy_fresh_sns() {
)
.await;

// Testing the Archive canister requires that it can be spawned.
eprintln!("Testing the Archive canister requires that it can be spawned ...");
sns::ensure_archive_canister_is_spawned_or_panic(
&pocket_ic,
sns.governance.canister_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async fn test_upgrade_existing_sns() {
)
.await;

eprintln!("Testing the Archive canister requires that it can be spawned. ...");
eprintln!("Testing the Archive canister requires that it can be spawned ...");
sns::ensure_archive_canister_is_spawned_or_panic(
&pocket_ic,
sns.governance.canister_id,
Expand Down

0 comments on commit 90f4535

Please sign in to comment.