Fix occasional port conflict in CLI integration test (#504)
This commit is contained in:
parent
350620b829
commit
1c9528e38f
|
@ -4,7 +4,7 @@ use nomos_cli::{
|
||||||
};
|
};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use tempfile::NamedTempFile;
|
use tempfile::NamedTempFile;
|
||||||
use tests::{nodes::nomos::Pool, MixNode, Node, NomosNode, SpawnConfig};
|
use tests::{get_available_port, nodes::nomos::Pool, MixNode, Node, NomosNode, SpawnConfig};
|
||||||
|
|
||||||
const TIMEOUT_SECS: u64 = 20;
|
const TIMEOUT_SECS: u64 = 20;
|
||||||
|
|
||||||
|
@ -16,7 +16,10 @@ async fn disseminate_blob() {
|
||||||
// kill the node so that we can reuse its network config
|
// kill the node so that we can reuse its network config
|
||||||
nodes[1].stop();
|
nodes[1].stop();
|
||||||
|
|
||||||
let network_config = nodes[1].config().network.clone();
|
let mut network_config = nodes[1].config().network.clone();
|
||||||
|
// use a new port because the old port is sometimes not closed immediately
|
||||||
|
network_config.backend.inner.port = get_available_port();
|
||||||
|
|
||||||
let mut file = NamedTempFile::new().unwrap();
|
let mut file = NamedTempFile::new().unwrap();
|
||||||
let config_path = file.path().to_owned();
|
let config_path = file.path().to_owned();
|
||||||
serde_yaml::to_writer(&mut file, &network_config).unwrap();
|
serde_yaml::to_writer(&mut file, &network_config).unwrap();
|
||||||
|
|
Loading…
Reference in New Issue