Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: make the W02 test not take a full minute on linux



Apparently on OSX (and other BSD kernels?) the pty device won't wait for
every last process closing its reference, but on Linux it does. We can
just set up the sleep commands to close their fds since they aren't
using them anyway.

---

Before:
/usr/bin/make TESTNUM=W02 check  0.33s user 0.13s system 0% cpu 59.896 total

After:
/usr/bin/make TESTNUM=W02 check  0.32s user 0.10s system 21% cpu 1.887 total

 Test/W02jobs.ztst | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/Test/W02jobs.ztst b/Test/W02jobs.ztst
index 25e187257b..f8011810c9 100644
--- a/Test/W02jobs.ztst
+++ b/Test/W02jobs.ztst
@@ -7,6 +7,7 @@
       export PS1= PS2=
       zpty -d
       zpty zsh "${(q)ZTST_testdir}/../Src/zsh -fiV +Z"
+      zpty -w zsh 'alias sleep="sleep 1>&- 2>&- 0<&-"'
     }
     zpty_input() {
       zpty -w zsh "${(F)@}" $'\n'
@@ -204,29 +205,29 @@
   zpty_stop
 0:jobs in sub-shell with job in parent shell
 *>\[1] <->
-*>\[1]  + * sleep 2
+*>\[1]  + * sleep 2*
 
   zpty_start
   zpty_input '( sleep 2 &; jobs ); :'
   zpty_stop
 0:jobs in sub-shell with job in same shell
-*>\[2]  + * sleep 2
+*>\[2]  + * sleep 2*
 
   zpty_start
   zpty_input 'sleep 2 &; jobs; ( sleep 3 &; jobs ); jobs; disown'
   zpty_stop
 0:jobs in sub-shell with job in parent + same shell
 *>\[1] <->
-*>\[1]  + * sleep 2
-*>\[2]  + * sleep 3
-*>\[1]  + * sleep 2
+*>\[1]  + * sleep 2*
+*>\[2]  + * sleep 3*
+*>\[1]  + * sleep 2*
 
   zpty_start
   zpty_input '( sleep 2 &; sleep 3 &; jobs ); :'
   zpty_stop
 0:jobs in sub-shell with two jobs in same shell
-*>\[2]  - * sleep 2
-*>\[3]  + * sleep 3
+*>\[2]  - * sleep 2*
+*>\[3]  + * sleep 3*
 
   zpty_start
   zpty_input 'sleep 2 &; sleep 3 &; disown; jobs; disown'
@@ -234,7 +235,7 @@
 0:disown current job
 *>\[1] <->
 *>\[2] <->
-*>\[1]  + * sleep 2
+*>\[1]  + * sleep 2*
 
   zpty_start
   zpty_input disown
@@ -248,7 +249,7 @@
 0:disown in sub-shell with job in parent shell
 *>\[1] <->
 *>disown: can't manipulate jobs in subshell
-*>\[1]  + * sleep 2
+*>\[1]  + * sleep 2*
 
   zpty_start
   zpty_input '( sleep 3 &; disown; jobs ); :'
@@ -260,7 +261,7 @@
   zpty_stop
 0:disown in sub-shell with job in parent + same shell
 *>\[1] <->
-*>\[1]  + * sleep 2
+*>\[1]  + * sleep 2*
 
 # @todo apparently testing suspended jobs with zpty is error-prone. see above
 #  zpty_start
@@ -292,9 +293,9 @@
   zpty_stop
 0:background and disown with &| and &!
 *>\[1] <->
-*>\[1] * sleep 2
+*>\[1] * sleep 2*
 *>\[1] <->
-*>\[1] * sleep 2
+*>\[1] * sleep 2*
 
   zpty_start
   zpty_input '( fg ); :'
-- 
2.38.1





Messages sorted by: Reverse Date, Date, Thread, Author