Reducing sleep times and timeout times in test_timeout

This commit is contained in:
Chris Dryden
2025-11-22 20:52:15 +01:00
committed by Sylvestre Ledru
parent 6d309b5bf4
commit e094bddcc9
+5 -5
View File
@@ -55,11 +55,11 @@ fn test_command_with_args() {
fn test_verbose() {
for verbose_flag in ["-v", "--verbose"] {
new_ucmd!()
.args(&[verbose_flag, ".1", "sleep", "10"])
.args(&[verbose_flag, ".1", "sleep", "1"])
.fails()
.stderr_only("timeout: sending signal TERM to command 'sleep'\n");
new_ucmd!()
.args(&[verbose_flag, "-s0", "-k.1", ".1", "sleep", "10"])
.args(&[verbose_flag, "-s0", "-k.1", ".1", "sleep", "1"])
.fails()
.stderr_only("timeout: sending signal EXIT to command 'sleep'\ntimeout: sending signal KILL to command 'sleep'\n");
}
@@ -112,7 +112,7 @@ fn test_preserve_status_even_when_send_signal() {
// So, expected result is success and code 0.
for cont_spelling in ["CONT", "cOnT", "SIGcont"] {
new_ucmd!()
.args(&["-s", cont_spelling, "--preserve-status", ".1", "sleep", "2"])
.args(&["-s", cont_spelling, "--preserve-status", ".1", "sleep", "1"])
.succeeds()
.no_output();
}
@@ -186,10 +186,10 @@ fn test_kill_subprocess() {
new_ucmd!()
.args(&[
// Make sure the CI can spawn the subprocess.
"10",
"1",
"sh",
"-c",
"trap 'echo inside_trap' TERM; sleep 30",
"trap 'echo inside_trap' TERM; sleep 5",
])
.fails_with_code(124)
.stdout_contains("inside_trap");