From dc4e6b6703513a5b1185af0f8beaaa203c04e028 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Wed, 21 May 2025 21:20:11 +0100 Subject: [PATCH] tests: avoid hung tests on older macOS These tests were seen to hang on PPC Mac OS X 10.4.11 * tests/cp/existing-perm-race.sh: Protect fifo interactions with a 1 minute timeout. * tests/cp/file-perm-race.sh: Likewise. Reported in https://bugs.gnu.org/78509 --- tests/cp/existing-perm-race.sh | 2 +- tests/cp/file-perm-race.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cp/existing-perm-race.sh b/tests/cp/existing-perm-race.sh index d45a5a3687..2a5a9215fa 100755 --- a/tests/cp/existing-perm-race.sh +++ b/tests/cp/existing-perm-race.sh @@ -44,7 +44,7 @@ cleanup_() { kill $pid 2>/dev/null && wait $pid; } # Copy a fifo's contents. That way, we can examine the # destination permissions before they're finalized. -cp -p --copy-contents fifo fifo-copy & pid=$! +timeout 60 cp -p --copy-contents fifo fifo-copy & pid=$! ( # Now 'cp' is reading the fifo. Wait for the destination file to diff --git a/tests/cp/file-perm-race.sh b/tests/cp/file-perm-race.sh index 2b4d1eb4bf..5c34e5b4a8 100755 --- a/tests/cp/file-perm-race.sh +++ b/tests/cp/file-perm-race.sh @@ -30,7 +30,7 @@ cleanup_() { kill $pid 2>/dev/null && wait $pid; } # Copy a fifo's contents. That way, we can examine the # destination permissions before they're finalized. -cp -p --copy-contents fifo fifo-copy & pid=$! +timeout 60 cp -p --copy-contents fifo fifo-copy & pid=$! ( # Now 'cp' is reading the fifo. Wait for the destination file to -- 2.47.3