From deaf479983285ddfd6eb488c17b1cd78d392df55 Mon Sep 17 00:00:00 2001 From: Keke Li Date: Sat, 10 Apr 2021 17:28:32 -0700 Subject: [PATCH 1/3] Allow the test script go ahead in case of $NODEOS_PID already shutdown before call wait. As the trace information is very limit. detail see epe889, the buildkite fails are very possible wait an already terminated NODEOS_PID --- tests/db_modes_test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/db_modes_test.sh b/tests/db_modes_test.sh index dc04e3d7d63..e0662751997 100755 --- a/tests/db_modes_test.sh +++ b/tests/db_modes_test.sh @@ -47,7 +47,8 @@ run_expect_success() { local NODEOS_PID=$! sleep 10 kill $NODEOS_PID - wait $NODEOS_PID + rc=0 + wait $NODEOS_PID && rc=$? || rc=$? } run_and_kill() { From 66b228a01e08d8862e9f29fe1747156c85b7f9be Mon Sep 17 00:00:00 2001 From: Keke Li Date: Tue, 13 Apr 2021 10:09:19 -0700 Subject: [PATCH 2/3] Add check to wait return code, if return code is 0 or 127 just let it go, in not, need stop and return the error code. --- tests/db_modes_test.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/db_modes_test.sh b/tests/db_modes_test.sh index e0662751997..fce71a033f4 100755 --- a/tests/db_modes_test.sh +++ b/tests/db_modes_test.sh @@ -49,6 +49,11 @@ run_expect_success() { kill $NODEOS_PID rc=0 wait $NODEOS_PID && rc=$? || rc=$? + if [[ rc -eq 127 || rc -eq 0 ]]; then + rc=0 + else + exit rc + fi } run_and_kill() { From 5c07fde4e79dfed9a98c51ab07be2c23f830f375 Mon Sep 17 00:00:00 2001 From: Keke Li Date: Tue, 13 Apr 2021 11:52:33 -0700 Subject: [PATCH 3/3] Return a return code in any case for the function run_expect_success() --- tests/db_modes_test.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/db_modes_test.sh b/tests/db_modes_test.sh index fce71a033f4..b9b7a47b0bf 100755 --- a/tests/db_modes_test.sh +++ b/tests/db_modes_test.sh @@ -51,9 +51,8 @@ run_expect_success() { wait $NODEOS_PID && rc=$? || rc=$? if [[ rc -eq 127 || rc -eq 0 ]]; then rc=0 - else - exit rc fi + return $rc } run_and_kill() {