Skip to content

Commit 7e236eb

Browse files
authored
fix for test_jormungandr_passive_node_starts_successfull. There was a case that test run forever instead of just fail (#1616)
1 parent e23c591 commit 7e236eb

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

jormungandr-integration-tests/src/common/jormungandr/process.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use super::logger::JormungandrLogger;
22
use crate::common::{
3-
configuration::jormungandr_config::JormungandrConfig, explorer::Explorer, jcli_wrapper,
3+
configuration::{jormungandr_config::JormungandrConfig, node_config_model::TrustedPeer},
4+
explorer::Explorer,
5+
jcli_wrapper,
46
};
57
use std::path::PathBuf;
68
use std::process::Child;
@@ -72,6 +74,13 @@ impl JormungandrProcess {
7274
.clone(),
7375
)
7476
}
77+
78+
pub fn as_trusted_peer(&self) -> TrustedPeer {
79+
TrustedPeer {
80+
address: self.config.node_config.p2p.public_address.clone(),
81+
id: self.config.node_config.p2p.public_id.clone(),
82+
}
83+
}
7584
}
7685

7786
impl Drop for JormungandrProcess {

jormungandr-integration-tests/src/jormungandr/bft/start_node.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,23 @@ pub fn test_jormungandr_leader_node_starts_successfully() {
1212
#[test]
1313
pub fn test_jormungandr_passive_node_starts_successfully() {
1414
let leader_config = ConfigurationBuilder::new().build();
15-
let _jormungandr_leader = Starter::new()
15+
let jormungandr_leader = Starter::new()
1616
.config(leader_config.clone())
1717
.start()
1818
.unwrap();
1919

2020
let passive_config = ConfigurationBuilder::new()
21-
.with_trusted_peers(vec![TrustedPeer {
22-
address: leader_config.node_config.p2p.public_address.clone(),
23-
id: leader_config.node_config.p2p.public_id.clone(),
24-
}])
21+
.with_trusted_peers(vec![jormungandr_leader.as_trusted_peer()])
2522
.with_block_hash(leader_config.genesis_block_hash)
2623
.build();
2724

28-
let _jormungandr_passive = Starter::new().config(passive_config).start().unwrap();
25+
let jormungandr_passive = Starter::new()
26+
.config(passive_config)
27+
.passive()
28+
.start()
29+
.unwrap();
30+
jormungandr_passive.assert_no_errors_in_log();
31+
jormungandr_leader.assert_no_errors_in_log();
2932
}
3033

3134
#[test]

0 commit comments

Comments
 (0)