From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19154 invoked by alias); 23 May 2016 14:53:04 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 38536 Received: (qmail 15343 invoked from network); 23 May 2016 14:53:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=o8Vd/it0DbTnNfUC2WlTOkSVYzJdvecsu74c5A6sKqA=; b=STxCgZ2hkfWxt0HP0mMPKDD4/cpITA/OSDOAkRcptaSWVW42OTGQZR2T/YiCSJraa5 pWjku3/KevX98fHiXpTTKO4fN0UMe8viuU1n+grrtZftqQ9ZgzOGv+8RZMzzxj2S0x7h L61iKJEXXyaE/qcyi/j+ak7gSIQ16wgZf9RTwOMM4H7mRzcpG1TB/A0C2rI2Gpmw9Hxv 97KqV3KGi5059sH+FFipRPjbS3RwNC2Ti31scdEqr2KXbyZ98nqkhMhTXkLBG5OoCRBx 7lEfoMUQGos7g1Z/1rweQS+gNrW5ywThYnOmRdXR4mwo0Y5z/3rEv+KlhUIRsbzDauNk SnGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=o8Vd/it0DbTnNfUC2WlTOkSVYzJdvecsu74c5A6sKqA=; b=IYCteF4oC6otFYqPYs0H60oa0/LOCA9idDrxFkT1p2Ifcgrwxj7SItmC6+2x2eM2wr bWoA5v12lJoQDL7XFSwLkz5Ah70X1svfnOJmZHOtNZxzU9Aq8E2I3Ehlmwd0f1ZFctbh AeeXwmb7ke4CKeqdS6u7zyo1rmmQ76KwnrFRnjsyYnTMv7t65sNE0d0wz15GshBcpnxH 2ui84Jm6LFZakyzSxsXq4gHcjfFsCXVricBW6Y6AcudlwQcPby5zokTimDQzNnvzS3Ny QZXSjOSMJK9tKA4R2utEnFrCo494kJiDwausMlxjyOOUvJt9EVDNg+NWXofDnTLaaWT+ zDjQ== X-Gm-Message-State: AOPr4FWenDOVvatZN8Vr2vZGRWBku0Hv3TwmFoACqkUJgV+GFxlgvsaZp4ib+7/hRfCrQZlTC0JQSE++/LUIrA== MIME-Version: 1.0 X-Received: by 10.55.33.102 with SMTP id h99mr16831271qkh.130.1464015181359; Mon, 23 May 2016 07:53:01 -0700 (PDT) In-Reply-To: <150324090941.ZM28427@torch.brasslantern.com> References: <20150319105716.620cd931@pwslap01u.europe.root.pri> <20150319125351.1e270c2d@pwslap01u.europe.root.pri> <20150320105703.2754b6af@pwslap01u.europe.root.pri> <150320090420.ZM21908@torch.brasslantern.com> <20150322183556.1fa0f143@ntlworld.com> <150322162235.ZM1728@torch.brasslantern.com> <20150323213426.21fd79c8@ntlworld.com> <150323175445.ZM32519@torch.brasslantern.com> <150323211241.ZM13580@torch.brasslantern.com> <150323214506.ZM13999@torch.brasslantern.com> <150324090941.ZM28427@torch.brasslantern.com> Date: Mon, 23 May 2016 16:53:01 +0200 Message-ID: Subject: Re: Testing interactive features (Re: capturing output of !! not working) From: Mikael Magnusson To: Bart Schaefer Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On Tue, Mar 24, 2015 at 5:09 PM, Bart Schaefer 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