Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,7 @@ jobs:
fi
- name: Test
run: |
# Run sequentially as a workaround until
# https://github.com/0xMiden/compiler/issues/766 is resolved
cargo make test -E 'package(miden-integration-node-tests)' --test-threads 1
cargo make test -E 'package(miden-integration-node-tests)'

cargo_publish_dry_run:
name: cargo publish dry run
Expand Down
37 changes: 9 additions & 28 deletions tests/integration-node/src/local_node/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use std::{
fs::{self, File},
io::BufRead,
net::TcpStream,
process::{Command, Stdio},
thread,
Expand Down Expand Up @@ -95,7 +94,13 @@ pub async fn start_shared_node() -> Result<u32> {
}

// Start the node process
let mut child = Command::new("miden-node")
// Use Stdio::null() for stdout/stderr to avoid buffer blocking issues.
// When pipes are used, the child process can block if the pipe buffer fills up
// and the reading end doesn't consume data fast enough. Using inherit() also
// causes issues with nextest's parallel test execution.
//
// For debugging, users can run the node manually with RUST_LOG=debug.
let child = Command::new("miden-node")
.args([
"bundled",
"start",
Expand All @@ -106,37 +111,13 @@ pub async fn start_shared_node() -> Result<u32> {
"--block.interval",
"1sec",
])
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.stdout(Stdio::null())
.stderr(Stdio::null())
.spawn()
.context("Failed to start miden-node process")?;

let pid = child.id();

// Capture output for debugging
let stdout = child.stdout.take().expect("Failed to capture stdout");
let stderr = child.stderr.take().expect("Failed to capture stderr");

// Check if node output logging is enabled
let enable_node_output = std::env::var("MIDEN_NODE_OUTPUT").unwrap_or_default() == "1";

// Spawn threads to read output
thread::spawn(move || {
let reader = std::io::BufReader::new(stdout);
for line in reader.lines().map_while(Result::ok) {
if enable_node_output {
eprintln!("[shared node stdout] {line}");
}
}
});

thread::spawn(move || {
let reader = std::io::BufReader::new(stderr);
for line in reader.lines().map_while(Result::ok) {
eprintln!("[shared node stderr] {line}");
}
});

// Detach the child process so it continues running after we exit
drop(child);

Expand Down