mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 07:47:09 +08:00
disown: add tests for disowned jobs in scripts
This commit is contained in:
parent
2720f3d2ef
commit
2c5d4937e3
@ -1,4 +1,19 @@
|
||||
#RUN: %fish %s
|
||||
|
||||
# Verify zombies are not left by disown (#7183, #5342)
|
||||
# Do this first to avoid colliding with the other disowned processes below, which may
|
||||
# still be running at the end of the script
|
||||
sleep 0.2 &
|
||||
disown
|
||||
sleep 0.2
|
||||
echo Trigger process reaping
|
||||
#CHECK: Trigger process reaping
|
||||
# The initial approach here was to kill the PID of the sleep process, which should
|
||||
# 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
|
||||
# (there should be none).
|
||||
ps -o state | string match 'Z*'
|
||||
|
||||
jobs -q
|
||||
echo $status
|
||||
#CHECK: 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user