From 82222571230f8fedb539f9143c24ac3dc8a9dcb0 Mon Sep 17 00:00:00 2001 From: peg Date: Tue, 3 Dec 2024 11:46:21 +0100 Subject: [PATCH] Handle p2p port --- crates/testing-utils/src/node_proc.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/testing-utils/src/node_proc.rs b/crates/testing-utils/src/node_proc.rs index 1990f2361..ccd4d045b 100644 --- a/crates/testing-utils/src/node_proc.rs +++ b/crates/testing-utils/src/node_proc.rs @@ -147,6 +147,11 @@ impl TestNodeProcessBuilder { } cmd.arg(format!("--rpc-port={}", self.port)); + if port != 9944 { + let (p2p_port, _http_port, _ws_port) = next_open_port() + .ok_or_else(|| "No available ports in the given port range".to_owned())?; + cmd.arg(format!("--port={p2p_port}")); + } // let ws_port = if self.scan_port_range { // // let (p2p_port, _http_port, ws_port) = next_open_port() // // .ok_or_else(|| "No available ports in the given port range".to_owned())?;