mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00: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
2 changed files with 5 additions and 3 deletions
|
@ -51,5 +51,7 @@ expect_prompt()
|
|||
# cmd_line contains the entire pipeline. proc_id and proc_name are set in a pipeline.
|
||||
sendline("true | sleep 6")
|
||||
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)
|
||||
|
|
|
@ -53,13 +53,13 @@ sendline(
|
|||
expect_prompt()
|
||||
sendline("sleep 5")
|
||||
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_prompt()
|
||||
|
||||
sendline("sleep 5")
|
||||
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_prompt()
|
||||
|
||||
|
|
Loading…
Reference in a new issue