mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
timeout: fix subprocess is never terminated
This commit is contained in:
parent
cf68665669
commit
f406b56f4a
3 changed files with 55 additions and 9 deletions
|
@ -138,3 +138,19 @@ fn test_kill_after_long() {
|
|||
.no_stdout()
|
||||
.no_stderr();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_kill_subprocess() {
|
||||
new_ucmd!()
|
||||
.args(&[
|
||||
// Make sure the CI can spawn the subprocess.
|
||||
"10",
|
||||
"sh",
|
||||
"-c",
|
||||
"sh -c \"trap 'echo xyz' TERM; sleep 30\"",
|
||||
])
|
||||
.fails()
|
||||
.code_is(124)
|
||||
.stdout_contains("xyz")
|
||||
.stderr_contains("Terminated");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue