From 30711eaf0c64ed23752cccddfe49135b281a8cf8 Mon Sep 17 00:00:00 2001 From: Phoeniix Zhao Date: Thu, 29 Feb 2024 09:41:31 +0800 Subject: [PATCH] fix: fix lock_rpc_validation stuck issue Signed-off-by: Phoeniix Zhao --- scripts/validation_test.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/validation_test.sh b/scripts/validation_test.sh index a40357b89..8ce94e664 100755 --- a/scripts/validation_test.sh +++ b/scripts/validation_test.sh @@ -18,16 +18,6 @@ trap stop TERM res="" -function parse_result() { - local tmp_res="" - while read -r line; do - log::debug $line - tmp_res="${tmp_res}${line}\n" - done - res="${tmp_res}" -} - - function check() { local pattern=$1 if [[ $(echo -e $res) =~ $pattern ]]; then @@ -37,10 +27,20 @@ function check() { fi } +function parse_result() { + local tmp_res="" + while read -r line; do + log::info $line + tmp_res="${tmp_res}${line}\n" + done + res="${tmp_res}" +} + function run() { command=$@ log::info "running: $command" - parse_result <<< "$(eval $command 2>&1)" + local run_res="$(eval $command 2>&1)" + parse_result <<< $run_res } # validate compact requests