Skip to content

Commit

Permalink
test: parallelize the ic_xc_cketh_test setup function (#3470)
Browse files Browse the repository at this point in the history
The P90 duration of the `//rs/tests/cross_chain:ic_xc_cketh_test` is 7
minutes which is longer than our maximum allowed of 5 minutes. This
commit parallelizes the setup function to shave of ~45 seconds.
  • Loading branch information
basvandijk authored Jan 16, 2025
1 parent 1f1d8dd commit 213bfee
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions rs/tests/cross_chain/ic_xc_cketh_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,26 @@ fn main() -> Result<()> {
}

fn setup_with_system_and_application_subnets(env: TestEnv) {
setup_anvil(&env);
InternetComputer::new()
.add_subnet(Subnet::new(SubnetType::System).add_nodes(1))
.add_subnet(
Subnet::new(SubnetType::Application)
.add_nodes(1)
.with_dkg_interval_length(Height::from(10)),
)
.setup_and_start(&env)
.expect("Failed to setup IC under test");
install_nns_with_customizations_and_check_progress(
env.topology_snapshot(),
NnsCustomizations::default(),
);
std::thread::scope(|s| {
s.spawn(|| {
setup_anvil(&env);
});
s.spawn(|| {
InternetComputer::new()
.add_subnet(Subnet::new(SubnetType::System).add_nodes(1))
.add_subnet(
Subnet::new(SubnetType::Application)
.add_nodes(1)
.with_dkg_interval_length(Height::from(10)),
)
.setup_and_start(&env)
.expect("Failed to setup IC under test");
install_nns_with_customizations_and_check_progress(
env.topology_snapshot(),
NnsCustomizations::default(),
);
});
});
}

fn setup_anvil(env: &TestEnv) {
Expand Down

0 comments on commit 213bfee

Please sign in to comment.