Files
hemx/hemx-test/tests/process.rs
T
2026-07-13 10:18:01 +02:00

32 lines
923 B
Rust

use hemx_test::TestProcess;
use std::process::Command;
use std::time::Duration;
#[test]
fn process_harness_reports_early_exit_with_context() {
// req: test/019
let mut command = Command::new(std::env::current_exe().expect("current test executable"));
command
.arg("--exact")
.arg("helper_process_exits_successfully")
.arg("--nocapture");
let error = match TestProcess::start(
command,
"short-lived helper",
"127.0.0.1:9",
Duration::from_secs(2),
) {
Ok(_) => panic!("a process that exits before readiness must fail startup"),
Err(error) => error,
};
let message = error.to_string();
assert!(message.contains("short-lived helper"), "{message}");
assert!(message.contains("127.0.0.1:9"), "{message}");
assert!(message.contains("exited with"), "{message}");
}
#[test]
fn helper_process_exits_successfully() {}