Subject: Re: Bug in C02cont.ztst's -N test
From: Bart Schaefer <[email-masked]>
To: Zsh hackers list <[email-masked]>
Date: Sat, 30 Apr 2016 11:11:31 -0700
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Apr 30, 10:55am, Bart Schaefer wrote:
}
} waiting one minute between creating and accessing the file, not just
} between the runs of "ls".  

I wrote that and I then I forgot to actually move the "cat".

Replacement patch:

diff --git a/Test/C02cond.ztst b/Test/C02cond.ztst
index f9fc185..d7a40ce 100644
--- a/Test/C02cond.ztst
+++ b/Test/C02cond.ztst
@@ -146,17 +146,28 @@
 
 # can't be bothered with -S
 
-  print -u $ZTST_fd 'This test takes two seconds...'
-  sleep 2
-  cat $unmodified
-  touch $newnewnew
+  if [[ ${mtab::="$({mount || /sbin/mount})"} = *[(]?*[)] ]]; then
+    print -u $ZTST_fd 'This test takes two seconds...'
+  else
+    unmodified_ls="$(ls -lu $unmodified)"
+    print -u $ZTST_fd 'This test takes up to 60 seconds...'
+  fi
   if [[ $OSTYPE == "cygwin" ]]; then
     ZTST_skip="[[ -N file ]] not supported on Cygwin"
   elif (( isnfs )); then
     ZTST_skip="[[ -N file ]] not supported with NFS"
-  elif { df -k -- ${$({mount || /sbin/mount} | awk '/noatime/ {print $1,$3}'):-""} | tr -s ' ' | fgrep -- "$(df -k . | tail -1 | tr -s ' ')" } >&/dev/null; then
+  elif { (( ! $+unmodified_ls )) &&
+         { sleep 2; cat $unmodified } &&
+         { df -k -- ${$(print -r -- "$mtab" |
+                        awk '/noatime/ {print $1,$3}'):-""} | tr -s ' ' |
+           fgrep -- "$(df -k . | tail -1 | tr -s ' ')" } >&/dev/null } ||
+       { (( $+unmodified_ls )) &&
+         ! repeat 30; do ZTST_hashmark; sleep 2; cat $unmodified
+             [[ $unmodified_ls != "$(ls -lu $unmodified)" ]] && break
+	   done }; then
     ZTST_skip="[[ -N file ]] not supported with noatime file system"
   else
+    touch $newnewnew
     [[ -N $newnewnew && ! -N $unmodified ]]
   fi
 0:-N cond