mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-25 04:22:04 +08:00
Try to fix tests for Solaris' ps
This commit is contained in:
parent
49bac252f6
commit
66bc6ce77d
@ -1,7 +1,14 @@
|
|||||||
#RUN: %fish %s
|
#RUN: %fish %s
|
||||||
|
|
||||||
# Ensure there's no zombies before we start, otherwise the tests will mysteriously fail.
|
# Ensure there's no zombies before we start, otherwise the tests will mysteriously fail.
|
||||||
set zombies_among_us (ps -o stat | string match 'Z*' | count)
|
set -l zombies_among_us
|
||||||
|
if not contains (uname) SunOS
|
||||||
|
set zombies_among_us (ps -o stat | string match 'Z*' | count)
|
||||||
|
else
|
||||||
|
# Solaris' ps is awkward, I don't know if this actually works
|
||||||
|
set zombies_among_us (ps -o s | string match 'Z*' | count)
|
||||||
|
end
|
||||||
|
|
||||||
[ "$zombies_among_us" -eq "0" ]
|
[ "$zombies_among_us" -eq "0" ]
|
||||||
or begin
|
or begin
|
||||||
echo "Found existing zombie processes. Clean up zombies before running this test."
|
echo "Found existing zombie processes. Clean up zombies before running this test."
|
||||||
@ -23,7 +30,11 @@ sleep 0.1
|
|||||||
# be gone by the time we get here. Unfortunately, kill from procps on pre-2016 distributions
|
# be gone by the time we get here. Unfortunately, kill from procps on pre-2016 distributions
|
||||||
# does not print an error for non-existent PIDs, so instead look for zombies in this session
|
# does not print an error for non-existent PIDs, so instead look for zombies in this session
|
||||||
# (there should be none).
|
# (there should be none).
|
||||||
ps -o stat | string match 'Z*'
|
if not contains (uname) SunOS
|
||||||
|
ps -o stat | string match 'Z*'
|
||||||
|
else
|
||||||
|
ps -o s | string match 'Z*'
|
||||||
|
end
|
||||||
|
|
||||||
# Verify disown can be used with last_pid, even if it is separate from the pgroup.
|
# Verify disown can be used with last_pid, even if it is separate from the pgroup.
|
||||||
# This should silently succeed.
|
# This should silently succeed.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user