From 8b7696f4c18fc6980424d1fc8b060c65199fedd9 Mon Sep 17 00:00:00 2001 From: Devyn Cairns Date: Sun, 21 Apr 2024 14:48:09 -0700 Subject: [PATCH] stress_internals: exit(1) on io error (#12612) # Description The `stress_internals` tests can fail sometimes, but usually not on the CI, because Nushell exits while the plugin is still trying to read or maybe write something, leading to a broken pipe. `nu-plugin` already exits with 1 without printing a message on a protocol-level I/O error, so this just doing the same thing. I think there's probably a way to correct the plugin handling so that we wait for plugins to shut down before exiting and this doesn't happen, but this is the quick fix in the meantime. --- crates/nu_plugin_stress_internals/src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/nu_plugin_stress_internals/src/main.rs b/crates/nu_plugin_stress_internals/src/main.rs index 3f95d5ef02..b05defe278 100644 --- a/crates/nu_plugin_stress_internals/src/main.rs +++ b/crates/nu_plugin_stress_internals/src/main.rs @@ -114,6 +114,8 @@ pub fn main() -> Result<(), Box> { Err(err) => { if err.is_eof() { break; + } else if err.is_io() { + std::process::exit(1); } else { return Err(err.into()); }