From 5fb972e85adbddb68fcc00781f98c06bf64027bb Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Tue, 20 Sep 2022 09:21:33 -0700 Subject: [PATCH] docs: More detail on timeouts --- src/cmd.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cmd.rs b/src/cmd.rs index 750764e..8b8358f 100644 --- a/src/cmd.rs +++ b/src/cmd.rs @@ -87,7 +87,7 @@ impl Command { self } - /// Error out if a timeout is reached + /// Error out if a timeout is reached. /// /// ```rust,no_run /// use assert_cmd::Command; @@ -96,9 +96,13 @@ impl Command { /// .unwrap() /// .timeout(std::time::Duration::from_secs(1)) /// .env("sleep", "100") - /// .assert(); - /// assert.failure(); + /// .assert() + /// .interrupted() // Child was interrupted. + /// .failure(); // More generally a timeout is a type of failure. /// ``` + /// + /// If the process does not complete before the timeout then it will be terminated + /// using [std::process::Child::kill], which on Unix sends a `SIGKILL`. pub fn timeout(&mut self, timeout: std::time::Duration) -> &mut Self { self.timeout = Some(timeout); self