chiark / gitweb /
test suite: stunt gnupg: Much better logging of race errors
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 4 Aug 2017 21:27:54 +0000 (22:27 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 4 Aug 2017 22:06:18 +0000 (23:06 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/run-all
tests/tstunt/gpg

index 3877c760a0aca1b40d3e756cedabd3ec28b0fef2..cfa5ce2ff1ac7c260ca04fd088547dd15b5aef84 100755 (executable)
@@ -15,6 +15,8 @@ fi
 
 mkdir -p tests/tmp
 
+export DGIT_GNUPG_STUNT_ERRLOG=$( tty -s ||: )
+
 (
  set -x
  exec make $jcpus -k -f tests/Makefile "$@"
index 790c46c86ed9a3d6b6cf2cfa872f8eb6f446c668..a108267d3ce568edc4abaaa1711ac1d3a8050778 100755 (executable)
@@ -15,6 +15,18 @@ if [ $rc != 2 ]; then exit $rc; fi
 
 echo >&2 "WARNING - GNUPG FAILED $rc - STUNT GNUPG $attempt $*"
 
+sh -ec '
+       if [ "x$DGIT_GNUPG_STUNT_ERRLOG" != x ]; then
+               exec >"$DGIT_GNUPG_STUNT_ERRLOG"
+       else
+               exec 2>/dev/null
+       fi
+       exec >/dev/tty
+       printf "%s\n" "$*"
+' x "GNUPG WRAPPER - TROUBLE - $HOME $GNUPGHOME - FAILED $rc $attempt $*"
+
+sleep 10
+
 done
 
 exit 127