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

Re: zargs with -P intermittently failing in zsh 5.9 and macOS



> 2022/05/30 20:16, Jun T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
> 
> (5) Revised patch with test

It seems this test "sometimes" fails on macOS:

--- /tmp/zsh.ztst.40838/ztst.err	2022-06-07 12:45:24.000000000 +0900
+++ /tmp/zsh.ztst.40838/ztst.terr	2022-06-07 12:45:25.000000000 +0900
@@ -0,0 +1 @@
+(eval):kill:4: kill 47169 failed: no such process
Test ./A05execution.ztst failed: error output differs from expected as shown above for:
  sleep 1 & pid=$!
  kill -STOP $pid
  sleep 1
  kill -CONT $pid
  wait $pid
Was testing: wait for stopped and continued process

The failed 'kill' is the second one: 'kill -CONT $pid'.
If I remove the 'sleep 1' between the two 'kill's then the test
always passes on macOS. But this is not a solution, because then
the test passes even without the patch for signals.c (at least on
Linux). The only way I can think of to make it pass on macOS (but
fails on Linux without the fix for signals.c) is to increase
the background sleep time to 'sleep 2'.

Is there any better solution? Or is this test necessary?

Patch for jobs.c below is just to silence the warning.


diff --git a/Src/jobs.c b/Src/jobs.c
index aa32f4e80..e0e453ed8 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -2221,7 +2221,9 @@ addbgstatus(pid_t pid, int status)
 {
     static long child_max;
     Bgstatus bgstatus_entry;
+#ifdef DEBUG
     LinkNode node;
+#endif
 
     if (!child_max) {
 #ifdef _SC_CHILD_MAX
diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst
index b257ddf2c..bcadc6d56 100644
--- a/Test/A05execution.ztst
+++ b/Test/A05execution.ztst
@@ -396,7 +396,7 @@ F:anonymous function, and a descriptor leak when backgrounding a pipeline
 # TBD: the 0 above is believed to be bogus and should also be turned
 # into 127 when the ccorresponding bug is fixed in the main shell.
 
-  sleep 1 & pid=$!
+  sleep 2 & pid=$!
   kill -STOP $pid
   sleep 1
   kill -CONT $pid







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