Skip to content

Commit 1ed2c2c

Browse files
authored
Merge pull request #799 from 0xMiden/greenhat/i766-node-500-error
2 parents 5c33211 + 1c86c8c commit 1ed2c2c

File tree

2 files changed

+10
-31
lines changed

2 files changed

+10
-31
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,7 @@ jobs:
314314
fi
315315
- name: Test
316316
run: |
317-
# Run sequentially as a workaround until
318-
# https://github.com/0xMiden/compiler/issues/766 is resolved
319-
cargo make test -E 'package(miden-integration-node-tests)' --test-threads 1
317+
cargo make test -E 'package(miden-integration-node-tests)'
320318
321319
cargo_publish_dry_run:
322320
name: cargo publish dry run

tests/integration-node/src/local_node/process.rs

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
use std::{
44
fs::{self, File},
5-
io::BufRead,
65
net::TcpStream,
76
process::{Command, Stdio},
87
thread,
@@ -95,7 +94,13 @@ pub async fn start_shared_node() -> Result<u32> {
9594
}
9695

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

114119
let pid = child.id();
115120

116-
// Capture output for debugging
117-
let stdout = child.stdout.take().expect("Failed to capture stdout");
118-
let stderr = child.stderr.take().expect("Failed to capture stderr");
119-
120-
// Check if node output logging is enabled
121-
let enable_node_output = std::env::var("MIDEN_NODE_OUTPUT").unwrap_or_default() == "1";
122-
123-
// Spawn threads to read output
124-
thread::spawn(move || {
125-
let reader = std::io::BufReader::new(stdout);
126-
for line in reader.lines().map_while(Result::ok) {
127-
if enable_node_output {
128-
eprintln!("[shared node stdout] {line}");
129-
}
130-
}
131-
});
132-
133-
thread::spawn(move || {
134-
let reader = std::io::BufReader::new(stderr);
135-
for line in reader.lines().map_while(Result::ok) {
136-
eprintln!("[shared node stderr] {line}");
137-
}
138-
});
139-
140121
// Detach the child process so it continues running after we exit
141122
drop(child);
142123

0 commit comments

Comments
 (0)