From 30d6b61e52bd69695126c9cd203a1f693c63ca41 Mon Sep 17 00:00:00 2001 From: samuel Date: Tue, 25 Apr 2023 15:09:32 +0200 Subject: [PATCH] [Fix] Close ncat server when error occurs to prevent uninterrupted test --- tests/runner.bats | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/runner.bats b/tests/runner.bats index f532451..eae58b6 100644 --- a/tests/runner.bats +++ b/tests/runner.bats @@ -46,7 +46,12 @@ send_request() ( ncat --listen --unixsock "${deployer_sock}" & "${runner_bin}" --conf="${conf_file}" --errs="${errs_file}" \ - --daemon --stop --verbose || return $? + --daemon --stop --verbose + code=$? + if [ "${code}" -ne 0 ]; then + echo "fail" | ncat --unixsock "${deployer_sock}" + return "${code}" + fi ( inotifywait --quiet --quiet --event create "${response_sock_dir}" echo "${request}" | ncat --unixsock "${runner_sock}"