Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tests): Address a port conflict issue in the regtest_submit_blocks test #8665

Merged
merged 1 commit into from
Jul 8, 2024
Merged
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
14 changes: 9 additions & 5 deletions zebrad/tests/common/regtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ use zebra_chain::{
serialization::ZcashSerialize,
};
use zebra_node_services::rpc_client::RpcRequestClient;
use zebra_rpc::methods::get_block_template_rpcs::get_block_template::{
proposal::TimeSource, proposal_block_from_template, GetBlockTemplate,
use zebra_rpc::{
methods::get_block_template_rpcs::get_block_template::{
proposal::TimeSource, proposal_block_from_template, GetBlockTemplate,
},
server::OPENED_RPC_ENDPOINT_MSG,
};
use zebra_test::args;

use crate::common::{
config::{random_known_rpc_port_config, testdir},
config::{os_assigned_rpc_port_config, read_listen_addr_from_logs, testdir},
launch::ZebradTestDirExt,
};

Expand All @@ -32,14 +35,15 @@ pub(crate) async fn submit_blocks_test() -> Result<()> {
info!("starting regtest submit_blocks test");

let network = Network::new_regtest(None);
let mut config = random_known_rpc_port_config(false, &network)?;
let mut config = os_assigned_rpc_port_config(false, &network)?;
config.mempool.debug_enable_at_height = Some(0);
let rpc_address = config.rpc.listen_addr.unwrap();

let mut zebrad = testdir()?
.with_config(&mut config)?
.spawn_child(args!["start"])?;

let rpc_address = read_listen_addr_from_logs(&mut zebrad, OPENED_RPC_ENDPOINT_MSG)?;

info!("waiting for zebrad to start");

tokio::time::sleep(Duration::from_secs(30)).await;
Expand Down
Loading