summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2026-06-11 05:11:17 +0200
committerMikael Magnusson <mikachu@gmail.com>2026-06-14 01:57:17 +0200
commit05d8a57d429a6756d07f767e0ecf34b536a7eda0 (patch)
tree02b209d8dc3886708a4f7e43e43998ab72d9b61a
parent54721: illegal -> invalid, invalid option -> bad option (diff)
downloadzsh-05d8a57d429a6756d07f767e0ecf34b536a7eda0.tar
zsh-05d8a57d429a6756d07f767e0ecf34b536a7eda0.tar.gz
zsh-05d8a57d429a6756d07f767e0ecf34b536a7eda0.tar.bz2
zsh-05d8a57d429a6756d07f767e0ecf34b536a7eda0.tar.lz
zsh-05d8a57d429a6756d07f767e0ecf34b536a7eda0.tar.xz
zsh-05d8a57d429a6756d07f767e0ecf34b536a7eda0.tar.zst
zsh-05d8a57d429a6756d07f767e0ecf34b536a7eda0.zip
54751: make the W02 test not take a full minute on linux
Apparently on OSX (and 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.
-rw-r--r--ChangeLog3
-rw-r--r--Test/W02jobs.ztst25
2 files changed, 16 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 79472d6ae..a8878ce34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2026-06-14 Mikael Magnusson <mikachu@gmail.com>
+ * 54751: Test/W02jobs.ztst: make the W02 test not take a full
+ minute on linux
+
* 54721: Doc/Zsh/expn.yo, Doc/intro.ms, Functions/Misc/zmv,
Src/Modules/zpty.c, Src/Modules/zutil.c, Src/Zle/compctl.c,
Src/Zle/computil.c, Src/Zle/zle_main.c, Src/Zle/zle_refresh.c,
diff --git a/Test/W02jobs.ztst b/Test/W02jobs.ztst
index 25e187257..d92885364 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 </dev/null >/dev/null 2>&1"'
}
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 ); :'