Subject: Re: [PATCH v14 12/13] fsmonitor: add tests for Linux

From: Junio C Hamano <[email-masked]>
Date: Tue, 14 Apr 2026 13:40:38 -0700

SZEDER Gábor <[email-masked]> writes:

>>  stop_daemon_delete_repo () {
>>  	r=$1 &&
>> -	test_might_fail git -C $r fsmonitor--daemon stop &&
>> +	test_might_fail maybe_timeout 30 \
>> +		git -C $r fsmonitor--daemon stop 2>/dev/null
>
> "test_might_fail" only allows a few select commands and functions, and
> the "maybe_timeout" helper function introduced in this patch is, of
> course, not one of them, so it returns with error and without running
> the given command.  Consequently, after this test script is finished I
> have still two fsmonitor daemon processes running in the background.
>
> Alas, this went unnoticed, because this patch broke the &&-chain and
> redirected "test_might_fail"'s
>
>   test_must_fail: only 'git' is allowed: maybe_timeout 30 git -C test_explicit fsmonitor--daemon stop
>
> error messages to /dev/null.  With the &&-chain restored over 40 test
> cases fail because of this.
>
>>  	rm -rf $1
>>  }

Yikes.  Would it help to apply a patch like this, then?

 t/t7527-builtin-fsmonitor.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git c/t/t7527-builtin-fsmonitor.sh w/t/t7527-builtin-fsmonitor.sh
index 774da5ac60..dfa06395f6 100755
--- c/t/t7527-builtin-fsmonitor.sh
+++ w/t/t7527-builtin-fsmonitor.sh
@@ -60,8 +60,7 @@ fi
 
 stop_daemon_delete_repo () {
 	r=$1 &&
-	test_might_fail maybe_timeout 30 \
-		git -C $r fsmonitor--daemon stop 2>/dev/null
+	maybe_timeout 30 git -C $r fsmonitor--daemon stop || : &&
 	rm -rf $1
 }