diff options
Diffstat (limited to 'Test/A05execution.ztst')
-rw-r--r-- | Test/A05execution.ztst | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst index ca97f4f41..589815f7c 100644 --- a/Test/A05execution.ztst +++ b/Test/A05execution.ztst @@ -190,9 +190,9 @@ print "${pipestatus[@]}") ZTST_hashmark done | sort | uniq -c | sed 's/^ *//' -0:Check whether `$pipestatus[]' behaves. +0:Check whether '$pipestatus[]' behaves. >2048 2 1 0 -F:This test checks for a bug in `$pipestatus[]' handling. If it breaks then +F:This test checks for a bug in '$pipestatus[]' handling. If it breaks then F:the bug is still there or it reappeared. See workers-29973 for details. { setopt MONITOR } 2>/dev/null @@ -244,3 +244,28 @@ F:anonymous function, and a descriptor leak when backgrounding a pipeline >autoload_redir () { > print Autoloaded ksh style >} > autoload.log + +# This tests that we record the status of processes that have already exited +# for when we wait for them. +# +# Actually, we don't guarantee here that the jobs have already exited, but +# the order of the waits means it's highly likely we do need to recall a +# previous status, barring accidents which shouldn't happen very often. In +# other words, we rely on the test working repeatedly rather than just +# once. The monitor option is irrelevant to the logic, so we'll make +# our job easier by turning it off. + unsetopt monitor + (exit 1) & + one=$! + (exit 2) & + two=$! + (exit 3) & + three=$! + wait $three + print $? + wait $two + print $? + wait $one +1:The status of recently exited background jobs is recorded +>3 +>2 |