mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-27 14:45:13 +08:00
Correct the order of pkill arguments
On macOS, the tests would often fail because calls to `pkill` would "leak" across tests: kill processes run by other tests. This is because on macOS, the -P argument to pkill must come before the process name. On Linux it doesn't matter. This improves test reliability on Mac.
This commit is contained in:
parent
2e24aaa605
commit
9070ed8039
@ -51,5 +51,7 @@ expect_prompt()
|
|||||||
# cmd_line contains the entire pipeline. proc_id and proc_name are set in a pipeline.
|
# cmd_line contains the entire pipeline. proc_id and proc_name are set in a pipeline.
|
||||||
sendline("true | sleep 6")
|
sendline("true | sleep 6")
|
||||||
sleep(0.100)
|
sleep(0.100)
|
||||||
call(["pkill", "-KILL", "sleep", "-P", str(sp.spawn.pid)])
|
# Beware: Mac pkill requires that the -P argument come before the process name,
|
||||||
|
# else the -P argument is ignored.
|
||||||
|
call(["pkill", "-KILL", "-P", str(sp.spawn.pid), "sleep"])
|
||||||
expect_re("[0-9]+:1:true|sleep 6:SIGKILL:Forced quit:[0-9]+:sleep", timeout=20)
|
expect_re("[0-9]+:1:true|sleep 6:SIGKILL:Forced quit:[0-9]+:sleep", timeout=20)
|
||||||
|
@ -53,13 +53,13 @@ sendline(
|
|||||||
expect_prompt()
|
expect_prompt()
|
||||||
sendline("sleep 5")
|
sendline("sleep 5")
|
||||||
sleep(0.100)
|
sleep(0.100)
|
||||||
subprocess.call(["pkill", "-INT", "sleep", "-P", str(sp.spawn.pid)])
|
subprocess.call(["pkill", "-INT", "-P", str(sp.spawn.pid), "sleep"])
|
||||||
expect_str("fish_kill_signal 2")
|
expect_str("fish_kill_signal 2")
|
||||||
expect_prompt()
|
expect_prompt()
|
||||||
|
|
||||||
sendline("sleep 5")
|
sendline("sleep 5")
|
||||||
sleep(0.100)
|
sleep(0.100)
|
||||||
subprocess.call(["pkill", "-TERM", "sleep", "-P", str(sp.spawn.pid)])
|
subprocess.call(["pkill", "-TERM", "-P", str(sp.spawn.pid), "sleep"])
|
||||||
expect_str("fish_kill_signal 15")
|
expect_str("fish_kill_signal 15")
|
||||||
expect_prompt()
|
expect_prompt()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user