diff --git a/crates/weft-app-shell/src/main.rs b/crates/weft-app-shell/src/main.rs index 3b68c29..4bed9ee 100644 --- a/crates/weft-app-shell/src/main.rs +++ b/crates/weft-app-shell/src/main.rs @@ -11,7 +11,11 @@ mod keyutils; use anyhow::Context; fn main() -> anyhow::Result<()> { + // Standard output carries the readiness line to weft-appd, which keeps + // standard error as the process's log. tracing_subscriber::fmt() + .with_writer(std::io::stderr) + .with_ansi(std::io::IsTerminal::is_terminal(&std::io::stderr())) .with_env_filter( tracing_subscriber::EnvFilter::try_from_default_env() .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")), diff --git a/crates/weft-runtime/src/main.rs b/crates/weft-runtime/src/main.rs index d5b5097..b94f5a4 100644 --- a/crates/weft-runtime/src/main.rs +++ b/crates/weft-runtime/src/main.rs @@ -14,7 +14,11 @@ const DEFAULT_MAX_MEMORY_MIB: usize = 256; use grants::{Grants, Preopen}; fn main() -> anyhow::Result<()> { + // Standard output carries the readiness line to weft-appd, which keeps + // standard error as the process's log. tracing_subscriber::fmt() + .with_writer(std::io::stderr) + .with_ansi(std::io::IsTerminal::is_terminal(&std::io::stderr())) .with_env_filter( tracing_subscriber::EnvFilter::try_from_default_env() .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")), diff --git a/tests/runtime/check_grants.py b/tests/runtime/check_grants.py index fcee9a3..34ca8b7 100644 --- a/tests/runtime/check_grants.py +++ b/tests/runtime/check_grants.py @@ -207,8 +207,9 @@ def check_hangup(runtime, work): process.wait(timeout=10) except subprocess.TimeoutExpired: raise AssertionError("the runtime kept running after its IPC connection closed") - output = process.stdout.read() + process.stderr.read() - if process.returncode != 0 or "IPC connection ended" not in output: + log = process.stderr.read() + process.stdout.read() + if process.returncode != 0 or "IPC connection ended" not in log: raise AssertionError(f"the runtime did not end with the connection: " f"exit {process.returncode}") finally: