From c0146c7c601270bc76fc0f294236905653e9ea51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Tue, 10 Nov 2026 17:55:07 +0000 Subject: [PATCH] tests: timeout: fix false failure with older bash This was seen on Centos 7 at least with bash 4.2.46. * tests/timeout/timeout.sh: Ensure the shell doesn't incorrectly optimize itself away when there are traps in place. Reported by Bruno Haible. --- tests/timeout/timeout.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/timeout/timeout.sh b/tests/timeout/timeout.sh index 91812df85..45ab9ab60 100755 --- a/tests/timeout/timeout.sh +++ b/tests/timeout/timeout.sh @@ -116,6 +116,7 @@ timeout -v .1 $SHELL -c ' exec 2>/dev/null # ensure no "Terminated" message blocks the trap trap "echo 1 >term.seen" TERM yes # Fill the pipe + : # Prevent shell exec optimization from discarding traps ' 2>&1 | { retry_delay_ file_seen .1 6 || touch term.missed; } test -e term.missed && fail=1