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.
This commit is contained in:
Devyn Cairns 2024-04-21 14:48:09 -07:00 committed by GitHub
parent a900166e27
commit 8b7696f4c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -114,6 +114,8 @@ pub fn main() -> Result<(), Box<dyn Error>> {
Err(err) => {
if err.is_eof() {
break;
} else if err.is_io() {
std::process::exit(1);
} else {
return Err(err.into());
}