zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: bug in zsh wait builtin - rhbz#1150541
Date: Sun, 26 Oct 2014 19:01:08 +0000	[thread overview]
Message-ID: <20141026190108.639ecd1c@pws-pc.ntlworld.com> (raw)
In-Reply-To: <20141026001717.4d4e3f5a@pws-pc.ntlworld.com>

Here's a test.  The tortuous explanation points out that we don't
absolutely guarantee on every run of the test that it's testing the
feature in question, but statistically it will be tested more often than
not.  So Axel will spot failures even if no one else does :-).

The changes in quotes earlier are just to deconfuse Emacs shell mode.

> Word not found in the Dictionary and Encyclopedia.

So what is the opposite of confuse?

pws

diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst
index ca97f4f..838cd74 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,29 @@ 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 a recall
+# previous status, barring accidents which shouldn't happen very often.  In
+# other words, we relying 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
+


  reply	other threads:[~2014-10-26 19:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21  7:53 Tim Speetjens
2014-10-21 20:02 ` Peter Stephenson
2014-10-22  6:55   ` Bart Schaefer
     [not found]     ` <CAO7vJOjrb=N3xuTJVSb7U8mdXtexYp8nN4YaoknfUb3fofU2zg@mail.gmail.com>
2014-10-22 15:48       ` Bart Schaefer
2014-10-22 18:32     ` Chet Ramey
2014-10-23  8:32     ` Peter Stephenson
2014-10-24  4:50       ` Bart Schaefer
2014-10-24  8:04         ` Tim Speetjens
2014-10-25 19:08         ` Peter Stephenson
2014-10-25 21:54           ` Bart Schaefer
2014-10-25 22:28           ` Bart Schaefer
2014-10-25 22:32             ` Bart Schaefer
2014-10-25 23:04               ` Peter Stephenson
2014-10-25 23:17                 ` Peter Stephenson
2014-10-26 19:01                   ` Peter Stephenson [this message]
2014-10-26 20:41                     ` Bart Schaefer
2014-10-26 21:22                       ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141026190108.639ecd1c@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).