Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rs/tests/consensus/catch_up_test_common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn test(env: TestEnv, expect_catch_up: bool) {
Height::from(slow_node_shut_down_height),
log.clone(),
);
malicious_node.vm().kill();
block_on(async { malicious_node.vm().await.kill().await });
info!(log, "Killed the slow node");

info!(log, "Wait another DKG interval, then restart the slow node");
Expand All @@ -94,7 +94,7 @@ fn test(env: TestEnv, expect_catch_up: bool) {
log.clone(),
)
});
malicious_node.vm().start();
block_on(async { malicious_node.vm().await.start().await });
info!(log, "Restarted slow node");

// Wait until the node is available again
Expand Down
4 changes: 3 additions & 1 deletion rs/tests/consensus/node_graceful_leaving_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ fn test(env: TestEnv) {
);

info!(log, "Kill nodes after removal (last shot to the victims)");
nns_nodes_to_remove.iter().for_each(|node| node.vm().kill());
nns_nodes_to_remove
.iter()
.for_each(|node| block_on(async { node.vm().await.kill().await }));
// Assert that `update` call can still be executed, this ensures that removed+killed nodes are not part of the consensus committee.
let update_message = b"This beautiful prose should be persisted for future generations";
block_on(async { assert_subnet_can_make_progress(update_message, nns_node).await });
Expand Down
18 changes: 15 additions & 3 deletions rs/tests/consensus/orchestrator/node_assign_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ fn test(env: TestEnv) {
let kill_nodes_count = UNASSIGNED_NODES_COUNT / 3;
info!(logger, "Kill {} of the new nodes", kill_nodes_count);
for n in newly_assigned_nodes.iter().take(kill_nodes_count) {
n.vm().kill();
block_on(async { n.vm().await.kill().await });
}

// Second loop to paralelize the effects of the previous one
Expand All @@ -191,7 +191,13 @@ fn test(env: TestEnv) {

// Kill one more node and break consensus.
info!(logger, "Kill one more node and break consensus");
newly_assigned_nodes[kill_nodes_count].vm().kill();
block_on(async {
newly_assigned_nodes[kill_nodes_count]
.vm()
.await
.kill()
.await
});
info!(logger, "Wait for it to become unavailable");
newly_assigned_nodes[kill_nodes_count]
.await_status_is_unavailable()
Expand All @@ -211,7 +217,13 @@ fn test(env: TestEnv) {

// Restart node to start consensus.
info!(logger, "Restart node to start consensus");
newly_assigned_nodes[kill_nodes_count].vm().start();
block_on(async {
newly_assigned_nodes[kill_nodes_count]
.vm()
.await
.start()
.await
});
info!(logger, "Wait for subnet to restart");
// Wait for 1 DKG interval to ensure that subnet makes progress again.
let target_height =
Expand Down
5 changes: 4 additions & 1 deletion rs/tests/consensus/tecdsa/tecdsa_remove_nodes_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use anyhow::Result;

use ic_system_test_driver::driver::group::SystemTestGroup;
use ic_system_test_driver::systest;
use ic_system_test_driver::util::block_on;

use canister_test::Canister;
use ic_base_types::NodeId;
Expand Down Expand Up @@ -125,7 +126,9 @@ fn test(env: TestEnv) {
EndpointsStatus::AllUnhealthy,
);
info!(log, "Kill nodes after removal (last shot to the victims)");
nns_nodes_to_remove.iter().for_each(|node| node.vm().kill());
nns_nodes_to_remove
.iter()
.for_each(|node| block_on(async { node.vm().await.kill().await }));
info!(log, "Verify signature");
block_on(async {
let msg_can = MessageCanister::from_canister_id(&nns_agent, canister_id);
Expand Down
4 changes: 2 additions & 2 deletions rs/tests/consensus/upgrade/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ pub fn stop_node(logger: &Logger, app_node: &IcNodeSnapshot) {
.await_status_is_healthy()
.expect("Node not healthy");
info!(logger, "Kill node: {}", app_node.get_ip_addr());
app_node.vm().kill();
block_on(async { app_node.vm().await.kill().await });
app_node
.await_status_is_unavailable()
.expect("Node still healthy");
Expand All @@ -375,7 +375,7 @@ pub fn start_node(logger: &Logger, app_node: &IcNodeSnapshot) {
.await_status_is_unavailable()
.expect("Node still healthy");
info!(logger, "Starting node: {}", app_node.get_ip_addr());
app_node.vm().start();
block_on(async { app_node.vm().await.start().await });
app_node
.await_status_is_healthy()
.expect("Node not healthy");
Expand Down
19 changes: 10 additions & 9 deletions rs/tests/driver/src/driver/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use crate::driver::{
},
test_setup::InfraProvider,
};
use crate::util::block_on;
use anyhow::{Context, Result, bail};
use config_tool::hostos::guestos_bootstrap_image::BootstrapOptions;
use config_tool::setupos::{
Expand Down Expand Up @@ -271,13 +272,13 @@ pub fn setup_and_start_vms(
&node,
&t_farm,
)?);
t_farm.attach_disk_images(
block_on(t_farm.attach_disk_images(
&group_name,
&vm_name,
"usb-storage",
vec![image_spec],
)?;
t_farm.start_vm(&group_name, &vm_name)?;
))?;
block_on(t_farm.start_vm(&group_name, &vm_name))?;
}
}
std::fs::remove_file(conf_img_path)?;
Expand Down Expand Up @@ -346,19 +347,19 @@ pub fn setup_and_start_nested_vms(
&t_ic_gateway_url,
t_nns_public_key_override.as_deref(),
)?;
let config_image_spec = AttachImageSpec::new(t_farm.upload_file(
let config_image_spec = AttachImageSpec::new(block_on(t_farm.upload_file(
&t_group_name,
config_image,
NESTED_CONFIG_IMAGE_PATH,
)?);
))?);

t_farm.attach_disk_images(
block_on(t_farm.attach_disk_images(
&t_group_name,
&vm_name,
"usb-storage",
vec![t_setupos_image_spec, config_image_spec],
)?;
t_farm.start_vm(&t_group_name, &vm_name)?;
))?;
block_on(t_farm.start_vm(&t_group_name, &vm_name))?;

Ok(())
}));
Expand Down Expand Up @@ -413,7 +414,7 @@ pub fn upload_config_disk_image(
) -> FarmResult<FileId> {
let compressed_img_path = mk_compressed_img_path();
let target_file = PathBuf::from(&node.node_path).join(compressed_img_path.clone());
let image_id = farm.upload_file(group_name, target_file, &compressed_img_path)?;
let image_id = block_on(farm.upload_file(group_name, target_file, &compressed_img_path))?;
info!(farm.logger, "Uploaded image: {}", image_id);
Ok(image_id)
}
Expand Down
Loading
Loading