zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: Testing interactive features (Re: capturing output of !! not working)
Date: Mon, 23 May 2016 16:53:01 +0200	[thread overview]
Message-ID: <CAHYJk3RsYfrFzXRG8ca35_ZDvLUXg8e_w_ZABHh0AQgxTeP9Wg@mail.gmail.com> (raw)
In-Reply-To: <150324090941.ZM28427@torch.brasslantern.com>

On Tue, Mar 24, 2015 at 5:09 PM, Bart Schaefer
<schaefer@brasslantern.com> wrote:
> On Mar 23,  9:45pm, Bart Schaefer wrote:
> } Subject: Re: Testing interactive features (Re: capturing output of !! not
> }
> } } ... a patch to comptest for the Test/X01* failure with no TTY.
> } }
> } } -    (( first++ )) && read -t 0.011 -k 1 < /dev/null
> } } +    (( first++ )) && read -t 0.011 -u 0 -k 1 < /dev/null
> }
> } Well, that shuts up the error message, but it also causes the 0.011
> } second timeout to be ignored.  The test still succeeds for me, but
> } should get a more thorough examination.
>
> If the real point is to sleep for 0.11 seconds, input needs to be
> redirected from somewhere that doesn't instantly return EOF.  That
> means tty or an open pipe.  Can anyone think of a less silly-looking
> way to do that, than the below?
>
> (The -u 0 -k 1 are probably redundant now.)
>
> First hunk is for a thinko in my %prep.
>
> diff --git a/Test/W01history.ztst b/Test/W01history.ztst
> index 2492c41..3a64530 100644
> --- a/Test/W01history.ztst
> +++ b/Test/W01history.ztst
> @@ -2,7 +2,7 @@
>
>  %prep
>
> -  [[ -t 0 ]] && print -u $ZTST_fd History tests write to /dev/tty
> +  if [[ -t 0 ]]; then print -u $ZTST_fd History tests write to /dev/tty; fi
>
>  %test
>
> diff --git a/Test/comptest b/Test/comptest
> index ef84217..20a3a5b 100644
> --- a/Test/comptest
> +++ b/Test/comptest
> @@ -164,7 +164,7 @@ zletest () {
>    for input; do
>      # zpty_flush Before zletest
>      # sleep for $KEYTIMEOUT
> -    (( first++ )) && read -t 0.011 -u 0 -k 1 < /dev/null
> +    (( first++ )) && { sleep 2 & } | read -t 0.011 -u 0 -k 1
>      zpty -n -w zsh "$input"
>    done
>    zpty -n -w zsh $'\C-X'

This patch causes the test suite to fail on a shell account I have
that has ulimit -l 50 in effect. X02 does about 90 tests, each of them
starts that sleep which stays around forever, and then real tests
can't fork. I don't know if we care about this situation or not, but
just thought I'd let you know. If there's an easy way to kill that
sleep synchronously on the next line, that'd be nice...

I was trying to do just that with something like
    { { (( first++ )) && { sleep 2 & echo $! } | read -t 0.011 -u 0 -k
1 } 9>&1 } | read
    (( REPLY )) && kill $REPLY
but the kill was failing every time, then I noticed this also seems to fix it,
    { (( first++ )) && { sleep 2 & } | read -t 0.011 -u 0 -k 1 } | :
and I am not sure why. It doesn't introduce any delays, so it's not
waiting for the sleep to finish; is it killing them automatically
because it's in a subshell? That's nice if so, but seems unlikely.

-- 
Mikael Magnusson


  reply	other threads:[~2016-05-23 14:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  1:49 capturing output of !! not working Vin Shelton
2015-03-19  2:28 ` Bart Schaefer
2015-03-19 10:57 ` Peter Stephenson
2015-03-19 12:27   ` Vin Shelton
2015-03-19 12:53     ` Peter Stephenson
2015-03-20 10:57       ` Peter Stephenson
2015-03-20 16:04         ` Bart Schaefer
2015-03-22 18:35           ` Peter Stephenson
2015-03-22 19:18             ` Peter Stephenson
2015-03-22 23:22             ` Bart Schaefer
2015-03-23 21:34               ` Peter Stephenson
2015-03-24  0:54                 ` Testing interactive features (Re: capturing output of !! not working) Bart Schaefer
2015-03-24  4:12                   ` Bart Schaefer
2015-03-24  4:45                     ` Bart Schaefer
2015-03-24 16:09                       ` Bart Schaefer
2016-05-23 14:53                         ` Mikael Magnusson [this message]
2015-03-25 15:48                 ` PATCH: Removing aliases from history, 2015 style (was " Peter Stephenson
2015-03-25 17:57                   ` PATCH: Removing aliases from history, 2015 style Peter Stephenson
2015-03-25 18:42                     ` Mikael Magnusson
2015-03-27 10:06                       ` Peter Stephenson
2015-03-27 15:25                         ` Bart Schaefer
2015-03-27 15:41                           ` Peter Stephenson
2015-03-27 17:17                             ` Bart Schaefer
2015-03-27 17:47                               ` Peter Stephenson
2015-03-29 18:38                         ` Peter Stephenson
2015-03-25 18:58                     ` Bart Schaefer
2015-03-25 19:40                   ` PATCH: Removing aliases from history, 2015 style (was capturing output of !! not working) Bart Schaefer
2015-03-26  3:43                     ` Word breaks around aliased tokens (was Re: PATCH: Removing aliases from history, 2015 style (was capturing output of !! not working)) Bart Schaefer
2015-03-30 18:04                       ` Daniel Shahaf
2015-03-30 20:05                         ` Mikael Magnusson
2015-03-30 18:08                       ` Daniel Shahaf
2015-03-26  9:41                     ` PATCH: Removing aliases from history, 2015 style (was capturing output of !! not working) Peter Stephenson
2015-03-26 15:22                       ` Bart Schaefer

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=CAHYJk3RsYfrFzXRG8ca35_ZDvLUXg8e_w_ZABHh0AQgxTeP9Wg@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=schaefer@brasslantern.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).