]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5564: fix test hang under zsh's sh mode
authorbrian m. carlson <sandals@crustytoothpaste.net>
Fri, 28 Nov 2025 01:21:06 +0000 (01:21 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 Nov 2025 03:06:03 +0000 (19:06 -0800)
This test starts a SOCKS server in Perl in the background and then kills
it after the tests are done.  However, when using zsh (in sh mode) in
the tests, the start_socks function hangs until the background process
is killed.

Note that this does not reproduce in a simple shell script, so there is
likely some interaction between job handling, our heavy use of eval in
the test framework, and possibly other complexities of our test
framework.  What is clear, however, is that switching from a compound
statement to a subshell fixes the problem entirely and the test passes
with no problem, so do that.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5564-http-proxy.sh

index c3903faf2d3e6fde2a36a9a19a325d52e44fc4b1..3bcbdef409b25feaffce02567578521e5c2dc494 100755 (executable)
@@ -40,10 +40,10 @@ test_expect_success 'clone can prompt for proxy password' '
 
 start_socks() {
        mkfifo socks_output &&
-       {
+       (
                "$PERL_PATH" "$TEST_DIRECTORY/socks4-proxy.pl" "$1" >socks_output &
                echo $! > "$TRASH_DIRECTORY/socks.pid"
-       } &&
+       ) &&
        read line <socks_output &&
        test "$line" = ready
 }