From ff6abe8a845f4099a7dde7c88d50619eb2e2f238 Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Wed, 6 Aug 2025 09:15:51 -0700 Subject: [PATCH] Fix pid tracking for conformance tests (#12714) Signed-off-by: Derek Nola --- tests/docker/test-helpers | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/docker/test-helpers b/tests/docker/test-helpers index 36f981905da..3ddf3837c0e 100755 --- a/tests/docker/test-helpers +++ b/tests/docker/test-helpers @@ -534,22 +534,18 @@ run-go-test() { ) if [ "$LABEL" ]; then - # Save original stdout and stderr - exec 3>&1 - exec 4>&2 - - exec > >(awk "{ printf \"[\033[36m${LABEL}\033[m] %s\n\", \$0; fflush() }") \ - 2> >(awk "{ printf \"[\033[35m${LABEL}\033[m] %s\n\", \$0; fflush() }" >&2) + # Redirect stdout and stderr to separate file descriptors for labeling + go test -timeout=45m -v "$@" \ + > >(awk "{ printf \"[\033[36m${LABEL}\033[m] %s\n\", \$0; fflush() }") \ + 2> >(awk "{ printf \"[\033[35m${LABEL}\033[m] %s\n\", \$0; fflush() }" >&2) & + else + go test -timeout=45m -v "$@" & fi - go test -timeout=45m -v "$@" & pids+=($!) if [ "$LABEL" ]; then - # Reset LABEL and restore stdout and stderr unset "LABEL" - exec 1>&3 2>&4 - exec 3>&- 4>&- fi } export -f run-go-test