From: Ian Jackson Date: Fri, 4 Aug 2017 21:27:54 +0000 (+0100) Subject: test suite: stunt gnupg: Much better logging of race errors X-Git-Tag: archive/debian/4.1~14 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=0450dc6909f1543a9515f9e686a5c01c7888073b test suite: stunt gnupg: Much better logging of race errors Signed-off-by: Ian Jackson --- diff --git a/tests/run-all b/tests/run-all index 3877c760..cfa5ce2f 100755 --- a/tests/run-all +++ b/tests/run-all @@ -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 "$@" diff --git a/tests/tstunt/gpg b/tests/tstunt/gpg index 790c46c8..a108267d 100755 --- a/tests/tstunt/gpg +++ b/tests/tstunt/gpg @@ -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