diff --git a/docker/test/stateful/run.sh b/docker/test/stateful/run.sh index 620fcef5b73..ddd59a324dc 100755 --- a/docker/test/stateful/run.sh +++ b/docker/test/stateful/run.sh @@ -62,7 +62,10 @@ read -ra ADDITIONAL_OPTIONS <<< "${ADDITIONAL_OPTIONS:-}" clickhouse-test --testname --shard --zookeeper --no-stateless --hung-check --print-time "$SKIP_LIST_OPT" "${ADDITIONAL_OPTIONS[@]}" "$SKIP_TESTS_OPTION" 2>&1 | ts '%Y-%m-%d %H:%M:%S' | tee test_output/test_result.txt -./process_functional_tests_result.py +./process_functional_tests_result.py || echo -e "failure\tCannot parse results" > /test_output/check_status.tsv -pigz < /var/log/clickhouse-server/clickhouse-server.log > /test_output/clickhouse-server.log.gz -mv /var/log/clickhouse-server/stderr.log /test_output/ +pigz < /var/log/clickhouse-server/clickhouse-server.log > /test_output/clickhouse-server.log.gz ||: +mv /var/log/clickhouse-server/stderr.log /test_output/ ||: +if [[ -n "$WITH_COVERAGE" ]] && [[ "$WITH_COVERAGE" -eq 1 ]]; then + tar -chf /test_output/clickhouse_coverage.tar.gz /profraw ||: +fi diff --git a/docker/test/stateless/run.sh b/docker/test/stateless/run.sh index 36b49dac961..9dd4cec585c 100755 --- a/docker/test/stateless/run.sh +++ b/docker/test/stateless/run.sh @@ -68,9 +68,12 @@ export -f run_tests timeout "$MAX_RUN_TIME" bash -c run_tests ||: -./process_functional_tests_result.py +./process_functional_tests_result.py || echo -e "failure\tCannot parse results" > /test_output/check_status.tsv -pigz < /var/log/clickhouse-server/clickhouse-server.log > /test_output/clickhouse-server.log.gz -mv /var/log/clickhouse-server/stderr.log /test_output/ +pigz < /var/log/clickhouse-server/clickhouse-server.log > /test_output/clickhouse-server.log.gz ||: +mv /var/log/clickhouse-server/stderr.log /test_output/ ||: +if [[ -n "$WITH_COVERAGE" ]] && [[ "$WITH_COVERAGE" -eq 1 ]]; then + tar -chf /test_output/clickhouse_coverage.tar.gz /profraw ||: +fi tar -chf /test_output/text_log_dump.tar /var/lib/clickhouse/data/system/text_log ||: tar -chf /test_output/query_log_dump.tar /var/lib/clickhouse/data/system/query_log ||: diff --git a/docker/test/stress/run.sh b/docker/test/stress/run.sh index 6799d1461cb..dcc92e1ad5f 100755 --- a/docker/test/stress/run.sh +++ b/docker/test/stress/run.sh @@ -57,6 +57,9 @@ detach quit " > script.gdb + # FIXME Hung check may work incorrectly because of attached gdb + # 1. False positives are possible + # 2. We cannot attach another gdb to get stacktraces if some queries hung gdb -batch -command script.gdb -p "$(cat /var/run/clickhouse-server/clickhouse-server.pid)" >> /test_output/gdb.log & } diff --git a/docker/test/stress/stress b/docker/test/stress/stress index 34dbdcfe10d..3426a20f67b 100755 --- a/docker/test/stress/stress +++ b/docker/test/stress/stress @@ -86,7 +86,7 @@ if __name__ == "__main__": logging.info("All processes finished") if args.hung_check: logging.info("Will terminate gdb (if any)") - res = call("kill -TERM $(pidof clickhouse)", shell=True, stderr=STDOUT) + res = call("kill -TERM $(pidof gdb)", shell=True, stderr=STDOUT) logging.info("Checking if some queries hung") cmd = "{} {} {}".format(args.test_cmd, "--hung-check", "00001_select_1") res = call(cmd, shell=True, stderr=STDOUT) diff --git a/docker/test/unit/run.sh b/docker/test/unit/run.sh index 037fd8494cb..abc35fa40d2 100644 --- a/docker/test/unit/run.sh +++ b/docker/test/unit/run.sh @@ -4,4 +4,4 @@ set -x service zookeeper start && sleep 7 && /usr/share/zookeeper/bin/zkCli.sh -server localhost:2181 -create create /clickhouse_test ''; gdb -q -ex 'set print inferior-events off' -ex 'set confirm off' -ex 'set print thread-events off' -ex run -ex bt -ex quit --args ./unit_tests_dbms | tee test_output/test_result.txt -./process_unit_tests_result.py +./process_unit_tests_result.py || echo -e "failure\tCannot parse results" > /test_output/check_status.tsv diff --git a/tests/clickhouse-test b/tests/clickhouse-test index 4044d29a49e..aeae7024250 100755 --- a/tests/clickhouse-test +++ b/tests/clickhouse-test @@ -223,7 +223,7 @@ def get_stacktraces_from_clickhouse(client): return subprocess.check_output("{} --allow_introspection_functions=1 --query " "\"SELECT arrayStringConcat(arrayMap(x, y -> concat(x, ': ', y), arrayMap(x -> addressToLine(x), trace), " "arrayMap(x -> demangle(addressToSymbol(x)), trace)), '\n') as trace " - "FROM system.stack_trace format Vertical\"".format(client), shell=True).decode('utf-8') + "FROM system.stack_trace format Vertical\"".format(client), shell=True, stderr=subprocess.STDOUT).decode('utf-8') except Exception as ex: print("Error occured while receiving stack traces from client: {}".format(str(ex))) return None