From d2ad200ff91585aa8eab424435d1e71d95536a05 Mon Sep 17 00:00:00 2001 From: Yanray Wang Date: Fri, 13 Jan 2023 10:52:41 +0800 Subject: [PATCH] Remove Terminated message from stdout Under Ubuntu-22.04, wait command prints out Terminated message if the process has been killed by kill command. This messes up the output in compat.sh Signed-off-by: Yanray Wang --- tests/compat.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/compat.sh b/tests/compat.sh index f6a51c4fb..a6efc65db 100755 --- a/tests/compat.sh +++ b/tests/compat.sh @@ -1129,11 +1129,13 @@ wait_client_done() { ( sleep "$DOG_DELAY"; echo "TIMEOUT" >> $CLI_OUT; kill $CLI_PID ) & WATCHDOG_PID=$! - wait $CLI_PID + # For Ubuntu 22.04, `Terminated` message is outputed by wait command. + # To remove it from stdout, redirect stdout/stderr to CLI_OUT + wait $CLI_PID >> $CLI_OUT 2>&1 EXIT=$? - kill $WATCHDOG_PID - wait $WATCHDOG_PID + kill $WATCHDOG_PID >/dev/null 2>&1 + wait $WATCHDOG_PID >> $CLI_OUT 2>&1 echo "EXIT: $EXIT" >> $CLI_OUT }