]> git.ipfire.org Git - thirdparty/git.git/commit
t7900: fix flaky test due to leaking background job
authorPatrick Steinhardt <ps@pks.im>
Mon, 19 Aug 2024 07:47:59 +0000 (09:47 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Aug 2024 16:36:23 +0000 (09:36 -0700)
commit759b453f9f21c5cda483a38f6693dfcbcb680290
treeb53d23471cf2a62eb278319e8a92eb40ac534499
parent98077d06b28b97d508c389886ee5014056707a5e
t7900: fix flaky test due to leaking background job

One of the recently-added tests in t7900 exercises git-maintanance(1)
with the `--detach` flag, which causes it to perform maintenance in the
background. We do not wait for the backgrounded process to exit though,
which causes the process to leak outside of the test, leading to racy
behaviour.

Fix this by synchronizing with the process via a separate file
descriptor. This is the same workaround as we use in t6500, see the
function `run_and_wait_for_auto_gc ()`.

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