diff --git a/docker/test/stateful_with_coverage/run.sh b/docker/test/stateful_with_coverage/run.sh index a7988736cb21238da8127a4ff5fea3ff9e0799c0..f91b51b033e1f838ec74698acffac1a497ea936b 100755 --- a/docker/test/stateful_with_coverage/run.sh +++ b/docker/test/stateful_with_coverage/run.sh @@ -1,11 +1,17 @@ #!/bin/bash kill_clickhouse () { - while kill -0 `pgrep -u clickhouse`; + kill `pgrep -u clickhouse` 2>/dev/null + + for i in {1..10} do - kill `pgrep -u clickhouse` 2>/dev/null - echo "Process" `pgrep -u clickhouse` "still alive" - sleep 10 + if ! kill -0 `pgrep -u clickhouse`; then + echo "No clickhouse process" + break + else + echo "Process" `pgrep -u clickhouse` "still alive" + sleep 10 + fi done } @@ -16,7 +22,7 @@ start_clickhouse () { wait_llvm_profdata () { while kill -0 `pgrep llvm-profdata-9`; do - echo "Waiting for profdata " `pgrep llvm-profdata-9` "still alive" + echo "Waiting for profdata" `pgrep llvm-profdata-9` "still alive" sleep 3 done } diff --git a/docker/test/stateless_with_coverage/run.sh b/docker/test/stateless_with_coverage/run.sh index 6515578b790b419a9e235a41e7fc25cff1e96377..bd702737274e3065f3032062b8424c7a19da523a 100755 --- a/docker/test/stateless_with_coverage/run.sh +++ b/docker/test/stateless_with_coverage/run.sh @@ -1,11 +1,17 @@ #!/bin/bash kill_clickhouse () { - while kill -0 `pgrep -u clickhouse`; + kill `pgrep -u clickhouse` 2>/dev/null + + for i in {1..10} do - kill `pgrep -u clickhouse` 2>/dev/null - echo "Process" `pgrep -u clickhouse` "still alive" - sleep 10 + if ! kill -0 `pgrep -u clickhouse`; then + echo "No clickhouse process" + break + else + echo "Process" `pgrep -u clickhouse` "still alive" + sleep 10 + fi done }