[PATCH v1 1/2] git-p4: kill p4d watchdog on cleanup
- From
larsxschneider@gmail.com <larsxschneider@gmail.com>
- Date
- Dec 20, 2015, 16:44 UTC
- Message-ID
- <1450629869-49522-2-git-send-email-larsxschneider@gmail.com>
- In-Reply-To
- <1450629869-49522-1-git-send-email-larsxschneider@gmail.com>
From: Lars Schneider <larsxschneider@gmail.com>
If failing tests are executed with the "immediate" flag then "kill_p4d" is not called and consequently the watchdog process, which is supposed to detect a hanging p4d, is not killed. Kill the watchdog always in the "on exit" cleanup trap.
Signed-off-by: Lars Schneider <larsxschneider@gmail.com> --- t/lib-git-p4.sh | 1 + 1 file changed, 1 insertion(+)
diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh index f9ae1d7..30bf7ae 100644 --- a/t/lib-git-p4.sh +++ b/t/lib-git-p4.sh @@ -76,6 +76,7 @@ pidfile="$TRASH_DIRECTORY/p4d.pid" # Sometimes "prove" seems to hang on exit because p4d is still running cleanup() { + kill -9 $watchdog_pid 2>/dev/null if test -f "$pidfile" then kill -9 $(cat "$pidfile") 2>/dev/null && exit 255 -- 2.5.1