Skip to content

Commit

Permalink
Merge pull request #2970 from Zeegomo/fix-panic-on-scenario-tests
Browse files Browse the repository at this point in the history
Start tokio runtime for scenario tests
  • Loading branch information
Mikhail Zabaluev authored Feb 4, 2021
2 parents 1ae2933 + 2338014 commit e2dc4f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ struct CommandArgs {
report: bool,
}

fn main() {
#[tokio::main]
async fn main() {
let command_args = CommandArgs::from_args();

std::env::set_var("RUST_BACKTRACE", "full");
Expand Down
6 changes: 2 additions & 4 deletions testing/jormungandr-scenario-tests/src/legacy/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub use jormungandr_testing_utils::testing::{
node::{grpc::JormungandrClient, JormungandrLogger},
FragmentNode, FragmentNodeError, MemPoolCheck,
};
use tokio::runtime;

use futures::executor::block_on;
use rand_core::RngCore;
Expand Down Expand Up @@ -527,9 +526,8 @@ impl LegacyNode {

LegacyNodeController {
alias: self.alias().clone(),
grpc_client: runtime::Runtime::new().unwrap().block_on(async {
JormungandrClient::from_address(&p2p_address).expect("cannot setup grpc client")
}),
grpc_client: JormungandrClient::from_address(&p2p_address)
.expect("cannot setup grpc client"),
settings: self.node_settings.clone(),
status: self.status.clone(),
progress_bar: self.progress_bar.clone(),
Expand Down
6 changes: 2 additions & 4 deletions testing/jormungandr-scenario-tests/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pub use jormungandr_testing_utils::testing::{
FragmentNode, MemPoolCheck, NamedProcess,
};
use jormungandr_testing_utils::{testing::node::Explorer, Version};
use tokio::runtime;

use futures::executor::block_on;
use indicatif::ProgressBar;
Expand Down Expand Up @@ -532,9 +531,8 @@ impl Node {

NodeController {
alias: self.alias().clone(),
grpc_client: runtime::Runtime::new().unwrap().block_on(async {
JormungandrClient::from_address(&p2p_address).expect("cannot setup grpc client")
}),
grpc_client: JormungandrClient::from_address(&p2p_address)
.expect("cannot setup grpc client"),
rest_client: JormungandrRest::new(rest_uri),
settings: self.node_settings.clone(),
status: self.status.clone(),
Expand Down

0 comments on commit e2dc4f8

Please sign in to comment.