]> Kevux Git Server - rit/commit
t/lib-git-p4: silence output when killing p4d and its watchdog
authorPatrick Steinhardt <ps@pks.im>
Thu, 4 Jun 2026 10:07:37 +0000 (12:07 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Jun 2026 12:49:00 +0000 (21:49 +0900)
commitc2d2d173ae6ba4b354a36b3ba732c8a11379d6ec
tree837d0f6dd3b85c6a826050a4106956ecc7d7541d
parentd11968661e641ea81f4c1938ae9f73a54107dc62
t/lib-git-p4: silence output when killing p4d and its watchdog

When stopping the p4d watchdog process via "kill -9", the shell may
print a job-control notification like:

  ./test-lib.sh: line 1269: 57960 Killed: 9               while true; do
      if test $nr_tries_left -eq 0; then
          kill -9 $p4d_pid; exit 1;
      fi; sleep 1; nr_tries_left=$(($nr_tries_left - 1));
  done 2> /dev/null 4>&2  (wd: ~)

This message is printed asynchronously by the shell when it reaps the
process. While harmless right now, this will cause breakage once we
enable strict parsing of the TAP protocol in a subsequent commit.

Fix this by using `wait` so that we can synchronously reap the watchdog
process and swallow the diagnostic.

While at it, deduplicate the logic we have in `stop_p4d_and_watchdog ()`
and `stop_and_cleanup_p4d ()`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-git-p4.sh